calvinmetcalf / shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
http://calvinmetcalf.github.io/shapefile-js/
714 stars 228 forks source link

coordinates must be finite numbers #182

Open jessegpierce opened 1 year ago

jessegpierce commented 1 year ago

I get 'coordinates must be finite numbers' error with the shapefile in this zip folder: https://www.eia.gov/maps/map_data/NaturalGas_InterIntrastate_Pipelines_US_EIA.zip image

Any way to fix this?

calvinmetcalf commented 1 year ago

try deleting the .prj file from the zipfile and try again it's actually an error in the library that transforms coordinates to lat lngs, but no transformation is needed here so that might fix it.

jessegpierce commented 1 year ago

That did it, thanks!

calvinmetcalf commented 1 year ago

the bigger issue is that that shapefile has a zero length line in it, which is technically legal so I'll push something up that handles that better.

On Fri, Jul 8, 2022 at 9:53 AM jessegpierce @.***> wrote:

That did it, thanks!

— Reply to this email directly, view it on GitHub https://github.com/calvinmetcalf/shapefile-js/issues/182#issuecomment-1179016118, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITRH6SXCCGYBSA36JMTS3VTAXGLANCNFSM5263T33A . You are receiving this because you commented.Message ID: @.***>

-- -Calvin W. Metcalf

andrea-spotsoftware commented 7 months ago

the bigger issue is that that shapefile has a zero length line in it, which is technically legal so I'll push something up that handles that better. On Fri, Jul 8, 2022 at 9:53 AM jessegpierce @.> wrote: That did it, thanks! — Reply to this email directly, view it on GitHub <#182 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITRH6SXCCGYBSA36JMTS3VTAXGLANCNFSM5263T33A . You are receiving this because you commented.Message ID: @.> -- -Calvin W. Metcalf

Hello @calvinmetcalf, any update on this? In my use case, deleting the .prj is fixing the error, but anything is printed on leaflet (I am using the Leaflet plugin).