今天,继续翻译我们的教程,这节讲的是第一个应用程序的快速启动(在项目中呈现一个地图)
Quickstart Application
Now that your environment is setup we can put together a simple Quickstart. This example will display a shapefile on screen.
1.Create the package org.geotools.tutorial.quickstart using your IDE.
2.Create the org.geotools.tutorial.quickstart.Quickstart class using your IDE.
3.Fill in the following code:
1. We need to download some sample data to work with. Thehttp://www.naturalearthdata.com/ project is a great project supported by the North American Cartographic Information Society. Head to the link below and download some cultural vectors. You can use the 'Download all 50m cultural themes' at top.
Please unzip the above data into a location you can find eaily such as the desktop.
- The shapefile is not loaded into memory - instead it is read from disk each and every time it is needed This approach allows you to work with data sets larger than available memory.
- We are using a very basic display style here that just shows feature outlines. In the examples that follow we will see how to specify more sophisticated styles
快速启动应用程序
- 这个shape文件并没有加载到内存中,而是在您每次需要的时候即时从硬盘中读取,这种方法允许您处理大于可用内存的数据集。
- 这个例子中,我们只是采用了最基本的展示风格——仅仅呈现要素轮廓,后面的例子中,我们将会详细列举更为复杂的展示样式。