geomoose / gm3

GeoMoose 3.0 Development. Please submit pull requests to the 'main' branch.
https://www.geomoose.org
MIT License
58 stars 59 forks source link

Switch to spherical area measurement #768

Closed theduckylittle closed 1 year ago

theduckylittle commented 1 year ago

This is a bit more accurate and avoids reprojection to UTM for area measurements.

Also handles graceful degenerate cases.

refs: #375

klassenjs commented 1 year ago

For the parcel containing 'Le Nores Airport (historic)' (PIN :130230001001):

Old Area: 3,455,444 sq.ft. (79.29 ac) New Area: 3,450,843 sq.ft. (79.18 ac) Identify Acres: 79.40 (presumably calculated according to local survey, but for all I know it is just whatever an old version of some GIS automatically calculated).

So we're looking at about a 0.1%-0.2% difference (at least for the demo). I'm not sure which one is (closest to) correct.

I'm not 100% convinced either is more accurate. UTM isn't an equal area projection and has distortion. But spherical is also wrong. Both are assuming some height above spheroid/ellipsoid that very likely not the same as the local ground elevation so neither will match direct ground measurements exactly.

In any case we should probably call out this change in the release notes in case anyone was relying on the old area numbers.

elil commented 1 year ago

When PostGIS Geography datatypes came out, there were some details on area and distance calculations. I think it involved moving to an appropriate projection, completing the calculations and then returning - or maybe that was the work around before Geography datatypes?

Size of object measured can impact things too (maybe a state-sized geometry would be different than an 80 acre parcel). Latitude can have a big impact as well depending on other factors. I think we have to limit ourselves to GIS and projections, not trying to find grid to ground scale factors to apply. This is around the corner in low distortion projections (LDPs - often getting that property by being at the right height to get a scale factor of 1). LDPs are becoming at least available if not yet the norm in the US and some other regions. Digging back out of the rabbit hole, for where things stand now, I think that the move to ol/sphere is a reasonable approach.

Agree with Jim about release notes.


From: Jim Klassen @.> Sent: Wednesday, January 4, 2023 9:53 AM To: geomoose/gm3 @.> Cc: Subscribed @.***> Subject: Re: [geomoose/gm3] Switch to spherical area measurement (PR #768)

For the parcel containing 'Le Nores Airport (historic)' (PIN :130230001001):

Old Area: 3,455,444 sq.ft. (79.29 ac) New Area: 3,450,843 sq.ft. (79.18 ac) Identify Acres: 79.40 (presumably calculated according to local survey, but for all I know it is just whatever an old version of some GIS automatically calculated).

So we're looking at about a 0.1%-0.2% difference (at least for the demo). I'm not sure which one is (closest to) correct.

I'm not 100% convinced either is more accurate. UTM isn't an equal area projection and has distortion. But spherical is also wrong. Both are assuming some height above spheroid/ellipsoid that very likely not the same as the local ground elevation so neither will match direct ground measurements exactly.

In any case we should probably call out this change in the release notes in case anyone was relying on the old area numbers.

— Reply to this email directly, view it on GitHubhttps://github.com/geomoose/gm3/pull/768#issuecomment-1371240761, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABIE7GR35JG7PDPPDNYFUP3WQW2H3ANCNFSM6AAAAAATPFCL2Q. You are receiving this because you are subscribed to this thread.Message ID: @.***>

theduckylittle commented 1 year ago

Definitely worth adding to the release notes. Might even be worth switching to using the getLength version from this package as well to ensure that lines are treated in a consistent manner. I'll PR that separately when I get a change (hopefully in the next few days).