nycivicengagementtable / spatial_join

https://spatial-join.herokuapp.com
1 stars 4 forks source link

Geojson polygons are losing specificity, recording values as "inf" #11

Open alemosie opened 7 years ago

alemosie commented 7 years ago

Two places to see this in action:

Snapshot of breakpoint in app:

screen shot 2017-02-12 at 7 57 49 pm

In geometry \"inf\" debugging.ipynb on the debug-inf branch. Explore both raw and processed data. The.to_crs(fiona.crs.from_epsg(2263)) is the root of the polygon value conversions.

This occurs in both master and more-headings (#9 pr) branches.

EDIT

Not sure if the infs are invalid, or merely the representation for real numbers. Either way, when I try to extract a single, transformed polygon through the Jupyter notebook, it kills my kernel.

Unrelated, but potentially relevant: https://github.com/WikiWatershed/rapid-watershed-delineation/issues/27.

Not sure if that applies to us. Maybe someone that worked with the geopandas library will have insight?

interglobalmedia commented 7 years ago

What I got in Heroku was an application break, and then later when I tried locally with our changes, I got "no data received" and nothing was sent. But the files did upload. They just didn't get transmitted. I'm also going to share the two posts I sent you here to keep things in one place:

http://flask.pocoo.org/docs/0.12/patterns/fileuploads/#uploading-files (Uploading Files: A General Introduction)

http://flask.pocoo.org/docs/0.12/security/#xss (Security Considerations: Cross Site Scripting XSS)

I'm definitely going to try and help out.

alemosie commented 7 years ago

When I ran the nycha.json file from our sample data through, this is what the crs conversion looked like:

screen shot 2017-02-19 at 9 41 01 am

Unfortunately, at this stage, the geojson crs conversion was still producing infs.

alemosie commented 7 years ago

Taking a look at the differences between raw sample json vs the NYCHA.geojson that Sonya provided (represented as raw_places below), I noticed that there is a huge discrepancy in the significant digits of the values. One has precise floats, the other ints. Example:

screen shot 2017-02-19 at 9 59 58 am

Also of note -- the sample json geometry objects are polygons, whereas the geojson objects are multipolygons.

afeld commented 7 years ago

I remember seeing infs when we didn't have the EPSG set properly in the code/files...any chance that's the issue here? In other words, perhaps the files you're trying are from a different geographic region? /cc #13