GeoServer配置

Quick Start

  1. 把你之前准备的shape文件复制到 (geoserver install)/data_dir/data/ ;
  2. 创建一个数据库指向你的shape文件: file:data/myShapefile.shp ;
  3. 创建一个 FeatureType 指向上一步所建的数据库;
  4. 设定 FeatureType 的标准 SRS 值,测试设为4326;
  5. 生成并发布。
  6. 测试 。http://127.0.0.1:端口/demo.do
下面是详细的英文步骤,有图:


STEP 1. Start GeoServer and Login STEP 1.1
Click on 'Start GeoServer' in your GeoServer folder (If you have not downloaded GeoServer, visithttp://www.geoserver.org/, click on the green "Download Now" button, and follow the directions).
Direct your internet browser to the GeoServer start page by opening http://localhost:8080/geoserver in a new browser.
STEP 1.2
Click 'Login'


Log yourself in with the username 'admin' and the password 'geoserver'



Click on 'Submit' and you're ready to start using GeoServer.
STEP 2. Create a DataStore Now we need to tell GeoServer what your data is and where you're storing it.
STEP 2.1
Click on the 'Config' button.


Next, click on the 'Data' button.

Then, click on the 'DataStores' button.


Finally, click on 'New'


STEP 2.2
Tell GeoServer what kind of data you're using.
Select 'Shapefile' from the Feature Data Set Description drop-down menu.Then pick a name for your data set and enter it in the Feature Data Set ID box (I'll use "tutorial" as an example).Then click 'New'

STEP 2.3
Pick the shapefile (.shp) you want to use, and enter its location in the 'url' box relative to the data directory (Note: Make sure the shapefile is located in the data_dir/data folder of GeoServer). For example, if the universal address of a shapefile named tutorial.shp was C:/Program_Files/GeoServer/data_dir/data/mytutorial/tutorial.shp, then I would enter file:data/mytutorial/tutorial.shp in the box.


Make sure all the other files associated with your shapefile (i.e. .dbf and .prj) are located in the same file (following the example above, all files would be located in the "mytutorial" folder).
When you are done, hit the 'Submit' button.
As of GeoServer 1.5.0, this will forward you to the FeatureType editor. If you need to get to the FeatureType page in the future you can navigate to it from the GeoServer homepage by going to Data -> FeatureTypes and selecting it from the drop down list.
STEP 3. Create The FeatureType STEP 3.1
This page allows you to customize how your data is presented on a map (text and polygon color, line thickness, etc.).Although there is a lot of information on this page, don't worry.You only need to pay attention to the 'Create New SLD,' 'Lookup SRS,' and 'Generate' buttons.
Find the "Style:" field and click on 'Create New SLD'

A new screen will appear that allows you to customize how your data will appear on a map.This page may differ slightly depending on what data you use.Just be sure to fill in all the required fields.Click the squares next to 'Text Color,' and 'Color of the lines' to select a color.Decide how wide, in pixels, you want your lines to be and enter that number in the 'Line dimensions' box.Click 'Apply Style' and then 'Finished'


Find the "Style:" field again, click on the dropdown menu menu and select the style that matches the name of your FeatureType (displayed just above the "Style:" field).

(Note: You can also pick an existing style from the dropdown menu if you don't want to create your own)


STEP 3.2
Find the "SRS" box and click on 'Lookup SRS.'A set of numbers should appear in the box.If the phrase "UNKNOWN" appears, type in the SRS for your dataset, if you don' t know try '4326' (lat/long - a common SRS) in the box. Or add your own projection.
Click 'Generate'


Click 'Submit' at the bottom of the page.

STEP 3.3
Finally, click 'Apply' and then 'Save' at the top left of the screen to store your data.


STEP 4. Try It Out STEP 4.1
The fastest way to view your data is to return to the GeoServer homepage, click on 'Demo,' and then click 'Map Preview.'Click on the 'Preview' button located next to your DataStore name.
For a more advanced view you'll actually have to dig into http://openlayers.org/, or check out the Clients section for other options, both desktop and web-based]
STEP 4.2
You can also view the data in Google Earth (sweet!). If you have Google Earth installed, all you have to do is open up a web browser and enter the URL below, replacing 'example' with your FeatureType name:
http://localhost:8080/geoserver/wms/kml_reflect?layers=example
(using the Mini-Map preview screenshot above, my url would look like this: http://localhost:8080/geoserver/wms/kml_reflect?layers=tgr15001lkD)
STEP 4.3

You can try out the WFS with this URL:
http://localhost:8080/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=example
You should get back a bunch of XML (GML), and it should look confusing, but you can probably make out the attributes of your file.

【GeoServer配置】转载于:https://www.cnblogs.com/yan5lang/archive/2009/06/22/1508308.html

    推荐阅读