Hey there, how are you guys doing?

I was playing around with WFS GetFeature requests of the sort:
http://demo.opengeo.org/geoserver/wfs?service=WFS&REQUEST=GetFeature&TYPENAME=topp:states&bbox=32,-84,33,-83

With regular GML output, a full description of each selected feature is 
given, including its typename (in this case, "topp:states"). However, if 
we specify OUTPUTFORMAT=JSON, then we receive a nice JSON description of 
the feature, but no typename information! The selected feature does 
indeed have a "type" attribute, but it says "Feature":

Request:
http://demo.opengeo.org/geoserver/wfs?service=WFS&REQUEST=GetFeature&TYPENAME=topp:states&bbox=32,-84,33,-83&OUTPUTFORMAT=json

Response:
{
  "type":"FeatureCollection",
  "features":[
{"type":"Feature","id":"states.19","properties":{"STATE_NAME":"Georgia",...},"geometry":{...},"geometry_name":"the_geom"}
  ],
  "crs":{"type":"EPSG","properties":{"code":"4326"}},
  "bbox":[30.361057000000002,-85.608994,35.000277999999994,-80.89492]}
}

Is there a reason for this lack of information? (by the way, is there a 
spec as to how WFS servers should give JSON output?)
I ask this because, if I include 2 layers in the request (e.g., 
"TYPENAME=topp:states,topp:world"), then how will I know the typename of 
each feature in the response? In this case, we would have:

Request:
http://demo.opengeo.org/geoserver/wfs?service=WFS&REQUEST=GetFeature&TYPENAME=topp:states,topp:world&bbox=32,-84,33,-83&OUTPUTFORMAT=json

Response:
{
  "type":"FeatureCollection",
  "features":[
{"type":"Feature","id":"states.19","properties":{"STATE_NAME":"Georgia",...},"geometry":{...},"geometry_name":"the_geom"},
{"type":"Feature","id":"world.209","properties":{"FIPS":"US",...},"geometry":{...},"geometry_name":"the_geom"}
  ]
  "crs":{"type":"EPSG","properties":{"code":"4326"}},
  "bbox":[18.923882000000106, -179.14199799999994, 71.36581400000006, 
179.77746600000012]
}

Cheers
Milton

-- 

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to