1

I am trying to parse a JSON output file from an .Mxd file. All work fine and the following SQL Insert in SSMS using sample coordinates:

  delete from RoomData
  insert into RoomData (Building_ID,Room,Shape) SELECT 1,'IrfanRoom',geometry::STPolyFromText('POLYGON ((531405.73999977112 104148.89000034332, 531414.71999979019 104179.65999984741, 531407.15999984741 104182.27999973297, 531406.94000005722 104182.35000038147, 531404.44000005722 104177.02000045776, 531401.59999990463 104168.5, 531401.59000015259 104168.47000026703,531401.48999977112 104168.19999980927,531395.61999988556 104152.19999980927,531405.73999977112 104148.89000034332))',4326)

DOES work in the sense that the ArcGIS Service page's query do return results and SSMS does show correct spatial data.

But..when I use some actual data coordinates in the above query, then the Service page doesn't return any results even though SSMS still does show correct spatial results. Here are the problematic coordinates:

 -9221155.6771000009 4120370.621299997,-9221155.0048999991 4120376.1005999967,-9221149.4818999991 4120375.4167999998,-9221150.1541000009 4120369.9375,-9221155.6771000009 4120370.621299997

What is happening here? I have tried srid of both 4326 and 3857 in the SQL inserts but still no luck. I don't have a great understanding of these coordinates and have been stumped for quite a while now. One clue is that any data with the actual coordinates don't load in ArcMap because I get error like 'coordinates exceed...'.

Edit: My data's projection, as seen in the .MXD is:

WGS_1984_Web_Mercator_Auxiliary_Sphere
Projection: Mercator_Auxiliary_Sphere
False_Easting:  0.00000000
False_Northing: 0.00000000
Central_Meridian:   0.00000000
Standard_Parallel_1:    0.00000000
Auxiliary_Sphere_Type:  0.00000000
Linear Unit:    Meter
4
  • 2
    You definitely need to learn how projections work, and learn what projection your data is really in. Your sample code sets SRID 4326, but 4326 is geographic- degrees- and your coordinates are clearly not in degrees (X range -180 to 180, Y range -90 to 90). – Russell at ISC Feb 24 '15 at 13:49
  • You are right and my boss directed me to: spatialreference.org/ref/sr-org/6864 ; – IrfanClemson Feb 24 '15 at 13:52
  • I have edited the question and included the data's projections. I need to move on--in time I will catch up with theory. Thanks. – IrfanClemson Feb 24 '15 at 14:08
  • I think I have an idea--my ArcGIS Service is in '4326' while the data itself, as can be seen, is in Web Mercator (probably 102100 (3857) )...I am going to fix the Service... – IrfanClemson Feb 24 '15 at 16:58
1

As Russell mentioned in the Comments to the Question above, I had the coordinates wrong: My sql for inserts was fine but the published ArcGIS Service was set at 4326 projections while the data was in Web Mercator 1002100 format. So I created a new .MXD file, exported its data to the SQL Server, then Published the .MXD as a new Service and everything works as expected.

Thanks Russell.

I hope this will help someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.