Select to view content in your preferred language

Incorrect query results for features with null geometries

1683
3
Jump to solution
05-14-2012 03:45 AM
MarkusHjärne
Deactivated User
Hi,

I've experienced a problem with null geometries in query results in SL API v.2.4.

When the first resulting feature in a query result has a null geometry, the geometries for all other features in the result becomes an Envelope geometry with NaN coordinate values.

Querying for two features, one of which has a null geometry, results in the following JSON result (I've manually removed some coordinates in the resulting geometry):

{   "objectIdFieldName" : "OBJECTID",   "globalIdFieldName" : "",   "fields" : [        ],   "features" : [     {       "attributes" : {                }     },     {       "geometry" : {         "rings" : [           [             [               379081.89869999979,               6166936.2956000008             ],             [               379097.42150000017,               6166860.2313999999             ],             [               379049.97439999972,               6166931.2594000008             ],             [               379081.89869999979,               6166936.2956000008             ]           ]         ]       },       "attributes" : {                }     }   ] }


while querying for only the feature that has a geometry results in:

{   "objectIdFieldName" : "OBJECTID",   "globalIdFieldName" : "",   "geometryType" : "esriGeometryPolygon",   "spatialReference" : {     "wkid" : 3006   },   "fields" : [        ],   "features" : [     {       "geometry" : {         "rings" : [           [             [               379081.89869999979,               6166936.2956000008             ],             [               379097.42150000017,               6166860.2313999999             ],             [               379049.97439999972,               6166931.2594000008             ],             [               379081.89869999979,               6166936.2956000008             ]           ]         ]       },       "attributes" : {                }     }   ] }


The geometry is returned in JSON in both cases, but the resulting Graphic's Geometry property is incorrect in the first case. Notice that the JSON fields "geometryType" and "spatialReference" is missing in the first case.

Is this a bug?

Best regards

Markus Hjärne
0 Kudos
1 Solution

Accepted Solutions
JenniferNery
Esri Regular Contributor
Thank you for reporting this bug. We have forwarded this to REST API team and we'll try to work around it in the next release of ArcGIS API for Silverlight.

I was able to repro in 10 SP1 but it seems fixed in sampleserver3 and 10.1

10.01 ??? ???geometryType??? is missing, feature with null geometry is returned first.
http://serverapps10.esri.com/ArcGIS/rest/services/GulfCoastTurtles/FeatureServer/0/query?objectIds=1...
10.0 ??? ???geometryType??? is present, feature with geometry (requested 2nd) is returned first.
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/query?objectId...
10.1 ??? (Pre-release) ???geometryType??? is present, feature with geometry (requested 2nd) is returned first.
http://servicesbeta4.esri.com/arcgis/rest/services/Notes/FeatureServer/0/query?where=&objectIds=3%2C...

View solution in original post

0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
There seems to be missing a geometryType property in that first json. Ex. "geometryType" : "esriGeometryPolygon". That's a required field, and since this isn't included, it's looks like a bug in the rest server.
0 Kudos
MarkusHjärne
Deactivated User
Thanks for confirming the bug. Should I repost this in the REST API forum, or will you forward it to them since it causes problems in the SL API?

By the way, are there any plans for a v2.5 with bug fixes of the SL API for ArcGIS Server 10.0?

/Markus
0 Kudos
JenniferNery
Esri Regular Contributor
Thank you for reporting this bug. We have forwarded this to REST API team and we'll try to work around it in the next release of ArcGIS API for Silverlight.

I was able to repro in 10 SP1 but it seems fixed in sampleserver3 and 10.1

10.01 ??? ???geometryType??? is missing, feature with null geometry is returned first.
http://serverapps10.esri.com/ArcGIS/rest/services/GulfCoastTurtles/FeatureServer/0/query?objectIds=1...
10.0 ??? ???geometryType??? is present, feature with geometry (requested 2nd) is returned first.
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/query?objectId...
10.1 ??? (Pre-release) ???geometryType??? is present, feature with geometry (requested 2nd) is returned first.
http://servicesbeta4.esri.com/arcgis/rest/services/Notes/FeatureServer/0/query?where=&objectIds=3%2C...
0 Kudos