ArcGISMap with absolute/custom SpatialReference

704
5
05-18-2023 01:34 AM
SalvadorApltp
New Contributor III

Hello,

We want to create a Base Map that does not reference any real Coordinate Systems, as a "local system", that is, someone wants to work with a system that absolutely begins at an arbitrary X:0 Y:0, regardless of the geographical representation.

An "empty canvas" at 0,0.

As far as I'm aware, in order to create an ArcGISMap object you absolutely need a WKID of some kind. Is there any way to create your own SpatialReference? From, say, 0 to 1000, or 1000 to 3000, or something of that sort. I didn't see anything after investigating the SDK but I thought I'd ask anyways.

Thank you kindly

0 Kudos
5 Replies
DiveshGoyal
Esri Regular Contributor

You can create a custom spatial reference using the well-known text format of coordinate system
You'll need to use this method -  https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/geometry/Spatia...)

The syntax of the well known text is described here - https://docs.geotools.org/stable/javadocs/org/opengis/referencing/doc-files/WKT.html

This documentation of ArcPy in ArcGIS Pro has some examples of wkt strings
https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/spatialreference.htm

0 Kudos
SalvadorApltp
New Contributor III

Thank you kindly, I will investigate these docs and try to create the custom spatial reference to create an "empty canvas". 

I will report and accept as solution if it works. Thank you!

0 Kudos
SalvadorApltp
New Contributor III

Hello, Divesh, I am not an expert on geospatial sciences, so perhaps I am misunderstanding, but I am trying this WKT to create the SpatialReference but I am getting a "ArcGISRuntimeException: Invalid argument.: bad wkt:" with this

"LOCAL_CS["Non-Earth (Meter)", LOCAL_DATUM["Local Datum", 0], UNIT["Meter", 1], AXIS["X", EAST], AXIS["Y", NORTH]]"

I would greatly appreciate a bit of help or a few tips on how to properly set up the WKT. 

0 Kudos
DiveshGoyal
Esri Regular Contributor

Unfortunately, I am out of my depth here.
My suggestion would be to start with the example shown in the ArcPy documentation and tweak one parameter at a time and see if the wkt yields a valid spatial reference.
Out of curiosity, what are you trying to achieve? 

0 Kudos
MelitaKennedy
Esri Notable Contributor

The closest you can get is to use either an arbitrary definition, for instance based on transverse Mercator, set the central meridian and latitude of origin to zero with the units you want and go from there. Another projection that could work is the "Local" projection. It's still geographic coordinate-based, but you can set it anyway. It additionally supports rotation, scale factor, and false easting/northing parameters (the last two reset the center point's values to whatever you want). 

Either one would still be based on a earth-based GCS like WGS84. There are some non-earth-based solar system GCS for the other planets and moons. 

Melita

0 Kudos