Select to view content in your preferred language

Determine SpatialReference Boundaries

960
7
06-23-2020 02:03 AM
KrisCulin
Frequent Contributor

Hello,

I would like to determine if a geometry is within the boundaries of the spatial reference.  In my particular case, all of our layers use the same spatial reference.  The geometry can be a point, polyline or polygon and is already in US Survey Feet (the same as the spatial reference).

Right now I am getting the Domain property of the SpatialReference and checking to see if the point is within it's XMin/XMax and Ymin/YMax values.  I have both a standard if block as well as using GeometryEngine.Contains.  In 99.44% of cases they seem to always return true.  In some rare instances, they return false.

The IntelliSense for the property seems to indicate that a MapPointa may not be valid even if it falls within this range.

I'd like to determine this before attempting to create the feature.

Is this the right approach or is there an alternative I should be using?

TIA.

Kris

0 Kudos
7 Replies
AnnetteLocke
Esri Contributor

Hi Kris,

The domain extent is different than the valid area of a coordinate system. The domain extent is an arbitrary square used to delimit valid coordinates for a spatial reference system and determine their resolution. It is possible that the domain extent is larger than the usable area of a coordinate system (a UTM zone, for example).

I suspect that what you are looking for is the horizon. We plan to add a method to get the horizon in a near-term release. In the meantime, you can take a look at https://community.esri.com/message/935357-re-how-to-get-the-spatialreference-horizon-polygon  for a possible workaround. 

I hope that helps. 

Thanks,

Annette

0 Kudos
BillFox
MVP Frequent Contributor

Hi @AnnetteLocke 

Am I reading this correctly?

I know the XY Extent is the "Envelope" of the currently existing feature in a feature class.

So what's the point of the domain extent being shown in a feature class's properties if it shows an "Envelope" of numbers that extend outside the allowable range of numbers in a State-plane projection like NAD83 California Zone 4 US Feet the feature class is in?

Why not show the allowable "Envelope" of that projection?

I think the Arc/Info coverage / Map Librarian used to do that to prevent data input errors "off the map".

Example:

BillFox_0-1747929558931.png

BillFox_1-1747929932097.png

https://www.conservation.ca.gov/cgs/rgm/state-plane-coordinate-system

 

 

0 Kudos
AnnetteLocke
Esri Contributor

Hi Bill, I have reached out to a colleague who knows more about this than I do to answer your question. You should be hearing from her soon.

Annette 

0 Kudos
BillFox
MVP Frequent Contributor
0 Kudos
MelitaKennedy
Esri Notable Contributor

Hi Bill, 

I'm sorry for the delay in responding. Annette did ask me to answer last week, but I'm afraid I got distracted. Okay, we're going to go into some history here. The spatial reference contains several items: 

coordinate system 
xy/z/m domains
xy/z/m resolutions (earlier called xyunits which was 1/xy_resolution)
xy/z/m tolerances

The latter three were originally defined because geodatabase feature classes (originally in ArcSDE) stored coordinate values as positive integers. In fact, they were originally had strict limits and were updated to "high precision" several years later. There was a maximum number of allowed integer values. A combination of the minimum x, minimum y, and EITHER the max x, max y OR the xyunits or xy resolution value controls the third thing. so if you set the min x/y and the xy resolution, the max integer values force how large the max x/y values can be. Or if you set the min/max x/y values, then the xy resolution (xyunits) value is then calculated. When we went to "high precision", that increased the maximum integer values by...a lot. 

The default minimum x/y values are set based on what's allowed mathematically for a projected coordinate system rather than the area of use for that particular pcs. At the time, for a custom PCS, we would have no idea what the area of use would be so better to use the allowed mathematical limits of the map projection. 

Resolution (1/xyunits) values determine the precision of stored coordinates. Our defaults for x/y are 1/10 mm or 0.0001 m. If you set xy domain to match the area of use, that usually forces the xy resolution to be really, really small which is unrealistic and can make handling and processing the data difficult. Instead, we usually set the minimum xy values and the resolution which instead makes the maximum xy values very, very large, much more than the area of use of the mathematical limits of the map projection. 

Min values for z and m are arbitrarily set to -100000, similar resolution values. For GCS (degrees usually), we use corresponding values to the defaults of a pcs, but the minimum xy are set to -400 and resolution is around 10e-9, I believe. 

Tolerance values have to be at least 2x the corresponding resolution value but our defaults set them to 10x, so 1 mm or its equivalent. 

In case I didn't explicitly define these earlier, an area of use is the where a PCS should used, like California State Plane zone VI covers San Diego, Imperial, Riverside, and Orange counties, while the xy extent is the mathematically valid area of the map projection. California VI uses Lambert conformal conic so it's most of the world. 

There is at least one white paper that discusses some of this. Here it is: Understanding Coordinate Management in the Geodatabase.

I hope this helps.

Melita

0 Kudos
MelitaKennedy
Esri Notable Contributor

Geodatabase went to "high precision" in ArcGIS Desktop 9.2, so late 2006. 

0 Kudos