<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div>
<meta content="text/html; charset=iso-8859-1">
</div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
Doing point in polygon in a projection will result in occasional wrong conclusions. A point near de edge can seem to be inside the polygon while it's outside, or the other way around, since a straight line in the projection deviates from the geodesic.</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
I analysed this problem for the Netherlands (51 - 55 degrees north) in the azimuthal projection
<span style="background-color: rgb(255, 255, 255); display: inline !important">(+proj=sterea) of</span> the national coordinate reference system RD <span style="background-color: rgb(255, 255, 255); display: inline !important">(epsg:28992) </span>and in plate-caree
projection (+proj=lonlat). The deviation depends on the length, orientation and location of a polygon segment. I computed the maximum possible deviation in the Netherlands for both projections to <span style="background-color: rgb(255, 255, 255); display: inline !important">advise
the Dutch government not to allow any segments longer than 200 m in a new digital storage system for policy and zoning borders.</span></div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
Table for the Netherlands: </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
Segment length, RD deviation, lonlat deviation; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
500 km, 160 m, 6 km; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
200 km, 25 m, 1 km; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
100 km, 6.4 m, 0.2 km; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
50 km, 1.6 m, 60 m; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
20 km, 26 cm, 9.7 m; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
10 km, 8 cm, 2.4 m; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
5 km, 3 cm, 60 cm; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
2 km, 5 mm, 9.7 cm; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
1 km, 1.3 mm, 2.4 cm; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
500 m, 0.3 mm, 6 mm; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
200 m, <0.1 mm, 1 mm; </div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;">100 m, <span style="background-color: rgb(255, 255, 255); display: inline !important"><0.1 mm,</span> 0.2 mm; </span></div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;">50 m, <0.1 mm, <span style="background-color: rgb(255, 255, 255); display: inline !important"><0.1 mm</span></span></div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;"><span style="background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;">This means that when you first split long segments of polygons by adding enough points along the geodesic, you could do a point in polygon even in lonlat. <span style="background-color: rgb(255, 255, 255); display: inline !important">The
required distance between the added points depends on the location (latitude). Near the poles it will get a bit tricky, as the maximum deviation increases to 50% of the size of the segment length.</span></span><br>
</div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;"><span style="background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;"><span style="background-color: rgb(255, 255, 255); display: inline !important">Regards, Jochem</span></span></div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<span style="font-size: 11pt;"><span style="background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></div>
<div dir="auto" style="direction: ltr; margin: 0px; padding: 0px; font-family: sans-serif; font-size: 11pt; color: black; text-align: left;">
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<span id="ms-outlook-mobile-signature">
<div><br>
</div>
</span><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> PROJ <proj-bounces@lists.osgeo.org> on behalf of Pierre Abbat <phma@bezitopo.org><br>
<b>Sent:</b> Sunday, March 29, 2020 1:27:00 AM<br>
<b>To:</b> proj@lists.osgeo.org <proj@lists.osgeo.org><br>
<b>Subject:</b> Re: [PROJ] How does proj deal with ellipsoid with respect to reprojection</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Saturday, 28 March 2020 10:58:53 EDT DeTracey, Brendan wrote:<br>
> Hi,<br>
> <br>
> I am using a gnomonic projection for point in polygon testing. The<br>
> transformation is:<br>
> <br>
> projinfo -s EPSG:4326 -t ' +type=crs +ellps=WGS84 +datum=WGS84 +proj=gnom<br>
> +lat_0=61.39107201212929 +lon_0=-58.56360634793518'<br>
> <br>
> Will transformed great circles still be straight lines? Or does the fact<br>
> that my source and target ellipse/datum are the same mean the gnomonic<br>
> projection has the WGS4 coordinates passed directly to it? My confusion<br>
> comes from gnomonic only being defined for a sphere, not an ellipsoid.<br>
<br>
In Bezitopo, I use a stereographic projection for point-in-polygon testing. <br>
This avoids the problem with the gnomonic projection that a polygon may cross <br>
the great circle which is projected to infinity. In stereographic, only one <br>
point is projected to infinity, and I chose it to be in the ocean, more than a <br>
megameter from any land, and with unround coordinates. Stereographic turns <br>
great circles into circles, so a spherical polygon turns into a polyarc in the <br>
plane, which I can handle easily.<br>
<br>
Pierre<br>
-- <br>
When a barnacle settles down, its brain disintegrates.<br>
Já não percebe nada, já não percebe nada.<br>
<br>
<br>
<br>
_______________________________________________<br>
PROJ mailing list<br>
PROJ@lists.osgeo.org<br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</div>
</span></font></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> PROJ <proj-bounces@lists.osgeo.org> on behalf of Pierre Abbat <phma@bezitopo.org><br>
<b>Sent:</b> Sunday, March 29, 2020 1:27:00 AM<br>
<b>To:</b> proj@lists.osgeo.org <proj@lists.osgeo.org><br>
<b>Subject:</b> Re: [PROJ] How does proj deal with ellipsoid with respect to reprojection</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Saturday, 28 March 2020 10:58:53 EDT DeTracey, Brendan wrote:<br>
> Hi,<br>
> <br>
> I am using a gnomonic projection for point in polygon testing. The<br>
> transformation is:<br>
> <br>
> projinfo -s EPSG:4326 -t ' +type=crs +ellps=WGS84 +datum=WGS84 +proj=gnom<br>
> +lat_0=61.39107201212929 +lon_0=-58.56360634793518'<br>
> <br>
> Will transformed great circles still be straight lines? Or does the fact<br>
> that my source and target ellipse/datum are the same mean the gnomonic<br>
> projection has the WGS4 coordinates passed directly to it? My confusion<br>
> comes from gnomonic only being defined for a sphere, not an ellipsoid.<br>
<br>
In Bezitopo, I use a stereographic projection for point-in-polygon testing. <br>
This avoids the problem with the gnomonic projection that a polygon may cross <br>
the great circle which is projected to infinity. In stereographic, only one <br>
point is projected to infinity, and I chose it to be in the ocean, more than a <br>
megameter from any land, and with unround coordinates. Stereographic turns <br>
great circles into circles, so a spherical polygon turns into a polyarc in the <br>
plane, which I can handle easily.<br>
<br>
Pierre<br>
-- <br>
When a barnacle settles down, its brain disintegrates.<br>
Já não percebe nada, já não percebe nada.<br>
<br>
<br>
<br>
_______________________________________________<br>
PROJ mailing list<br>
PROJ@lists.osgeo.org<br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</div>
</span></font></div>
<BR>
<BR>
<FONT SIZE=2>
Disclaimer:<BR>
De inhoud van dit bericht is uitsluitend bestemd voor geadresseerde.<BR>
Gebruik van de inhoud van dit bericht door anderen zonder toestemming van het Kadaster<BR>
is onrechtmatig. Mocht dit bericht ten onrechte bij u terecht komen, dan verzoeken wij u<BR>
dit direct te melden aan de verzender en het bericht te vernietigen.<BR>
Aan de inhoud van dit bericht kunnen geen rechten worden ontleend.<BR>
<BR>
Disclaimer:<BR>
The content of this message is meant to be received by the addressee only.<BR>
Use of the content of this message by anyone other than the addressee without the consent<BR>
of the Kadaster is unlawful. If you have received this message, but are not the addressee,<BR>
please contact the sender immediately and destroy the message.<BR>
No rights can be derived from the content of this message.<BR></body>
</html>