alaux

RelationshipQuery outSpatialReference

Discussion created by alaux on Aug 28, 2013
Latest reply on Aug 29, 2013 by JGravois-esristaff
I am having trouble setting the outSpatialReference property on the RelationshipQuery object.  I am querying a featurelayer with a wkid of 102300, and want it to return in 102100.  It appears the outSpatialReference property has been applied, but whenever the results come back, they are always in 102300.  The outSR property is not included in the outgoing REST request, even after setting this property in code.

When running the same query in the ArcGIS Server Rest html interface, the outSR param is properly appended and executed.  Has anybody else experienced this behavior in the javascript API?

I can't figure out any other solution except to change the spatial reference of my map service to 102100.

var relatedTopsQuery = new RelationshipQuery();
                relatedTopsQuery.outFields = ["*"];
                relatedTopsQuery.relationshipId = this.activeRelationshipId;
                relatedTopsQuery.returnGeometry = true;
                relatedTopsQuery.outSpatialReference = this.map.spatialReference;
                relatedTopsQuery.objectIds = [this.selectedRouteId];

                this.routeFeatureLayer.queryRelatedFeatures(relatedTopsQuery, lang.hitch(this, this.relatedFeaturesQueryComplete));

Outcomes