Discussion:
[Community] Getting some bizarre areas...
Ari Simmons
2014-02-25 09:46:03 UTC
Permalink
Hello (again)...

I am attempting to re-create yet another Visvilingam simplify algorithm
using Shapely/Fiona (...this is mostly an effort to experiment with
Fiona/Shapely).

I have some test data (trivial in size -- polygons under 700 sq meters),
but in calculating the triangles (which all should be less then 700 sq.
meters)...I am pulling out areas in the millions.

I've exhaustively run through the way I am picking up points (and
calculating area)...so to try this a different way...could this all have
something to do with the Fiona reading/writing...? A projection issue
perhaps...? From what I can tell the file reads and outputs fine -- I am
just getting really large areas out of my 'not that big' polygons.

Anybody ever had something like this come up? Or have a tip...

P.S> I didn't really think posting my code is going to be that helpful, but
here is a link to my Git[2] if nothing I said above computes...since the
test data was small I added it in too...


[1]: https://pypi.python.org/pypi/Fiona . I modeled most the read/write
code based on what I found on the site ...but in my noobness might be
totally not getting it...
[2]: https://github.com/ARSimmons/Shapely_Fiona_Visvalingam_Simplify
my git, with code and the trivial size polygons if you want to see what I
mean...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gispython.org/pipermail/community/attachments/20140225/ee0b706f/attachment.htm>
Ari Simmons
2014-02-25 09:54:10 UTC
Permalink
..data is in Pseudo Mercator...unit meters...in Georgia/Florida
whereabouts...and still under 700 sq meters...
Post by Ari Simmons
Hello (again)...
I am attempting to re-create yet another Visvilingam simplify algorithm
using Shapely/Fiona (...this is mostly an effort to experiment with
Fiona/Shapely).
I have some test data (trivial in size -- polygons under 700 sq meters),
but in calculating the triangles (which all should be less then 700 sq.
meters)...I am pulling out areas in the millions.
I've exhaustively run through the way I am picking up points (and
calculating area)...so to try this a different way...could this all have
something to do with the Fiona reading/writing...? A projection issue
perhaps...? From what I can tell the file reads and outputs fine -- I am
just getting really large areas out of my 'not that big' polygons.
Anybody ever had something like this come up? Or have a tip...
P.S> I didn't really think posting my code is going to be that helpful,
but here is a link to my Git[2] if nothing I said above computes...since
the test data was small I added it in too...
[1]: https://pypi.python.org/pypi/Fiona . I modeled most the read/write
code based on what I found on the site ...but in my noobness might be
totally not getting it...
[2]: https://github.com/ARSimmons/Shapely_Fiona_Visvalingam_Simplify
my git, with code and the trivial size polygons if you want to see what I
mean...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gispython.org/pipermail/community/attachments/20140225/ad3624b6/attachment.htm>
Sean Gillies
2014-02-25 18:47:55 UTC
Permalink
Hi Ari,
Post by Ari Simmons
Post by Ari Simmons
import fiona
from shapely.geometry import shape
... with fiona.open('poly_test/polygon.shp') as src:
... for f in src:
... print shape(f['geometry']).area
...
660.036866573
635.789329099

That's what you expect, right? Fiona and Shapely are doing the right thing,
so I think there could be misplaced coordinates in your triangles.

Thanks for providing a link to the repo, it makes debugging a lot easier!
Post by Ari Simmons
..data is in Pseudo Mercator...unit meters...in Georgia/Florida
whereabouts...and still under 700 sq meters...
Post by Ari Simmons
Hello (again)...
I am attempting to re-create yet another Visvilingam simplify algorithm
using Shapely/Fiona (...this is mostly an effort to experiment with
Fiona/Shapely).
I have some test data (trivial in size -- polygons under 700 sq meters),
but in calculating the triangles (which all should be less then 700 sq.
meters)...I am pulling out areas in the millions.
I've exhaustively run through the way I am picking up points (and
calculating area)...so to try this a different way...could this all have
something to do with the Fiona reading/writing...? A projection issue
perhaps...? From what I can tell the file reads and outputs fine -- I am
just getting really large areas out of my 'not that big' polygons.
Anybody ever had something like this come up? Or have a tip...
P.S> I didn't really think posting my code is going to be that helpful,
but here is a link to my Git[2] if nothing I said above computes...since
the test data was small I added it in too...
[1]: https://pypi.python.org/pypi/Fiona . I modeled most the read/write
code based on what I found on the site ...but in my noobness might be
totally not getting it...
[2]: https://github.com/ARSimmons/Shapely_Fiona_Visvalingam_Simplify
my git, with code and the trivial size polygons if you want to see what I
mean...
_______________________________________________
Community mailing list
Community at lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community
--
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gispython.org/pipermail/community/attachments/20140225/8114492d/attachment.htm>
Ari Simmons
2014-02-27 18:47:21 UTC
Permalink
Hi Sean,

Yup -- those are the areas. I think I figured it out now (it was the coord.
algebra). Nasty little buggy. Thanks for the sanity check though!
Post by Ari Simmons
..data is in Pseudo Mercator...unit meters...in Georgia/Florida
whereabouts...and still under 700 sq meters...
Post by Ari Simmons
Hello (again)...
I am attempting to re-create yet another Visvilingam simplify algorithm
using Shapely/Fiona (...this is mostly an effort to experiment with
Fiona/Shapely).
I have some test data (trivial in size -- polygons under 700 sq meters),
but in calculating the triangles (which all should be less then 700 sq.
meters)...I am pulling out areas in the millions.
I've exhaustively run through the way I am picking up points (and
calculating area)...so to try this a different way...could this all have
something to do with the Fiona reading/writing...? A projection issue
perhaps...? From what I can tell the file reads and outputs fine -- I am
just getting really large areas out of my 'not that big' polygons.
Anybody ever had something like this come up? Or have a tip...
P.S> I didn't really think posting my code is going to be that helpful,
but here is a link to my Git[2] if nothing I said above computes...since
the test data was small I added it in too...
[1]: https://pypi.python.org/pypi/Fiona . I modeled most the read/write
code based on what I found on the site ...but in my noobness might be
totally not getting it...
[2]: https://github.com/ARSimmons/Shapely_Fiona_Visvalingam_Simplify
my git, with code and the trivial size polygons if you want to see what I
mean...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gispython.org/pipermail/community/attachments/20140227/a73403cb/attachment.htm>
Loading...