3

I have downloaded and installed GeoServer 2.1-RC1 which shipped with RESTconfig. How can i check whether REST service is installed with GeoServer or Not ?

I put this "http://localhost:8080/geoserver/rest" in my browser, but it gives error! ... It means REST service is not installed as i understand. Or is there any other method to check whether the service is installed or not ?

underdark
  • 84,148
  • 21
  • 231
  • 413
user1899
  • 1,427
  • 7
  • 29
  • 36

2 Answers2

4

Have you tried any of the configuration examples in the docs (here)?

You can access layer information through e.g. http://localhost:8080/geoserver/rest/layers/giant_polygon.html

Publishing a shapefile works like this:

Consider a directory on the server /data/shapefiles/roads that contains the Shapefile roads.shp. The following adds a new datastore for the Shapefile:

curl -u admin:geoserver -XPUT -H 'Content-type: text/plain' \
-d 'file:///data/shapefiles/roads/roads.shp' \
http://localhost:8080/geoserver/rest/workspaces/acme/datastores/roads/external.shp

Source: Geoserver REST Docs (Also describes how to add a PostGIS layer.)

underdark
  • 84,148
  • 21
  • 231
  • 413
  • Actually i want to know, How i publish my data – user1899 Feb 13 '11 at 20:34
  • Please explain which step is causing you troubles. Have you checked http://docs.geoserver.org/stable/en/user/gettingstarted/index.html? – underdark Feb 13 '11 at 20:42
  • Actually i want to know, How i publish my data by using REST service. because My data is published by Geoserver default protocols wfs or wms. I can see wms, wfs and wcs services on geoserver web page services section at http://localhost:8080/geoserver/web/. But i could not see REST any where. How can i see REST or can check wether its available or not? – user1899 Feb 13 '11 at 20:43
  • Have you tried something like http://localhost:8080/geoserver/rest/layers/giant_polygon.html? – underdark Feb 13 '11 at 21:15
  • Thanks for replying!. I got following reply: Layer "giant_polygon" Name: giant_polygon Default style: StyleInfoImpl[giant_polygon] Available styles: [] Now please explain how i publish my data by REST service on Geoserver ? – user1899 Feb 14 '11 at 08:24
  • Do you mean: a) How to upload a file to Geoserver using REST? or b) How to consume a file published via Geoserver using REST? – underdark Feb 14 '11 at 10:51
  • Yes. I need both a) and b) as you said. Please also explain, How ArcGIS API for javascript client will access the published data from Geoserver? We can query data to ArcGIS Sampleserver by using code as: queryTask = new esri.arcgis.gmaps.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"); – user1899 Feb 14 '11 at 11:02
  • Yes. I need both a) and b) as you said. Please also explain, How ArcGIS API for javascript client will access the published data from Geoserver? e.g, We can query data to ArcGIS Sampleserver by using code as: queryTask = new esri.arcgis.gmaps.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"); What URL string should i use in the the above line of code? Is this URL (localhost:8080/geoserver/rest/layers/giant_polygon.html) valid ? suppose if want to query giant_polygon. – user1899 Feb 14 '11 at 11:15
  • ad a) See my updated answer. ad b) Are you referring to this QueryTask: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/query_nomap.html? – underdark Feb 14 '11 at 11:34
  • Yes exactly, so what URL should i use instead of ("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"); URL ? – user1899 Feb 14 '11 at 12:11
  • 2
    I doubt that it is possible to get ArcGIS Javascript API to work with Geoserver using REST. Why not use something standardized like WMS? http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/layers_wms.html – underdark Feb 14 '11 at 12:15
  • As I mentioned on another question, ArcGIS Javascript API expects an Arcgis server -- I can't be sure that any other free alternative implements rest in the exact same way that ArcGIS server does. Please refer to http://gis.stackexchange.com/questions/771/what-are-some-web-based-clients-for-geoserver for a list of alternative APIs. – relima Feb 14 '11 at 12:27
  • I have posted my question in this forum 6 days ago and one of the user of this forum advised me that you can use Geoserver with ArcGIS API for javescript (because i dont have ArcGIS Server). By Using Geoserver with REST, we can make same type of query as in ArcGIS case. further u can check this post: http://gis.stackexchange.com/questions/5905/how-to-access-shp-file-from-local-computer-or-some-other-server – user1899 Feb 14 '11 at 12:51