5

I have a polygon and a point feature class in some projection. The points are contained within the polygons

The points are always inside the polygons no matter the projection destination I'm projecting points and polygons to (including 'unprojecting' to geographic).


Putting visually JGH example I have a big polygon in WKID =4326 with a point outside of it...

WKID 4326

...when I project them (say in 3347 to follow JGH example) I get this...

enter image description here

where the point now is inside the polygon. I used the ArcGIS Pro 'project' function.

When I use project setting the optional parameter 'Preserve Shape' as in the following picture.

enter image description here

...I get something definitely better like...

enter image description here

where (hopefully) the point stays outside the polygon. 'Preserve shape' parameter did what outlined by J.R. Extra vertices that provide a better discretization of the polygon in the destination projection....otherwise everything is reduced to projecting 4 vertices and drawing straight lines in the destination space to connect them (producing the indesiderable output of the second picture above)

Am I getting this right ?

8

Some software will use great circle arcs to connect unprojected vertices (sometimes when using a special data type, like PostGIS geography), while projected (or unprojected using the geometry datatype) vertices are connected using straight lines.

This can result in a point being inside a polygon expressed as geography but outside of it if expressed as geometry

The following example uses PostGIS. The polygon goes up to latitude 50, the point is at latitude 51.

WITH poly AS (select ST_GeomFromText('polygon((0 0, 50 0, 50 50, 0 50, 0 0))',4326) as geom),
  pnt AS (select ST_GeomFromText('point(25 51)',4326) as geom)
SELECT ST_INTERSECTS(poly.geom,pnt.geom) intersect_geometry,
    ST_INTERSECTS(poly.geom::geography,pnt.geom::geography) intersect_geography
FROM poly, pnt;

 intersect_geometry | intersect_geography
--------------------+---------------------
 f                  | t

Edit

Extending on @JR comment, here is an example when projecting a huge polygon to a Lambert Conformal Conic projection (3347) and checking the point intersection near the central meridian: we can see a difference of 4 degrees of latitude between the two!

WITH poly AS (select ST_GeomFromText('polygon((-70 45, -130 45, -130 50, -70 50, -70 45))',4326) as geom),
   pnt AS (select ST_GeomFromText('point(-100 54)',4326) as geom)
SELECT ST_INTERSECTS(poly.geom,pnt.geom) intersect_geometry,
     ST_INTERSECTS(st_transform(poly.geom,3347),st_transform(pnt.geom,3347)) intersect_reproject
FROM poly, pnt;

 intersect_geometry | intersect_reproject
--------------------+---------------------
 f                  | t
  • Same in SQL server... – Supereshek May 29 at 9:55
2

Yes. projections will never reproject a point that was inside a polygon in one projection to be outside it in another--unless there's some sort of precision error. I'm not sure what this property is called in geography, but I just realized it's essentially relativistic invariance, which basically says that as time dilates for us, and our coordinate systems are compressed or stretched, no observer in any given frame will disagree on causal ordering of events. Likewise, no matter in what projection an "observer lives", no one will disagree on what points are in what polygons, even if they disagree on exactly how far the points are from the edges of the polygons, and stuff like that.

  • Well, except for horizon clipping, and discontinuous projections, which might throw a monkey wench in topology. – Vince May 28 at 16:53
  • 3
    Not sure but I think the question come from the way polygon may be incorrectly reprojected as in a big polygon defined by only corner vertex. When reprojecting you will project the corner then reconstruct the polygon by linking the corner with a straight line. In this case a point close to the border could be seen on the other side after reprojecting but that's because the projection is wrong along the length of the side (to prevent that you need to add vertex on the polygon side before reprojecting) – J.R May 28 at 16:54
  • I hadn't considered horizons or discontinous projections. I guess like in physics geography does have singularities where certain space-time coordinate systems break down; poles are another example. – 0mn1 May 28 at 19:37
  • Yes...as J.R. is saying my question comes from the way a polygon may be incorrectly re-projected. I think ArcGIS 'Project' accounts for this if you use "preserve_shape" optional parameter. It adds extra vertices in order to get a better projected shape. – Supereshek May 29 at 9:54
  • @J.R I see. Is it correct to say that this happens because the PostGIS geometry is a different projection than the geography? If I connect to points on unprojected data with a straight line, then do the same thing with correct geodesic calculations and add that (apparently) curved line to the map, then there will be points between them. But the straight line was never the correct line for unprojected lon-lat data--it's not like the line is shifting from one side of a point to the other between two projections, rather the geometry projection is wrong. – 0mn1 May 29 at 14:00

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.