Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting to geojson from shapefile #51

Open
mcgregorian1 opened this issue Oct 28, 2021 · 0 comments
Open

Error converting to geojson from shapefile #51

mcgregorian1 opened this issue Oct 28, 2021 · 0 comments

Comments

@mcgregorian1
Copy link

mcgregorian1 commented Oct 28, 2021

Issue

I've used the porder convert command a few times, but in the last couple days I've started getting some error warnings about an invalid CRS input, and because of this the geojsons are not created.

My workflow:

  • initialize planet
  • take a coordinate, create a buffer of 500m around it and save as a shapefile polygon with projection CRS("+proj=utm +zone=46, +ellps=WGS84")
  • convert to geojson using porder convert

Result:

This has worked fine in the past several weeks, but yesterday for the first time I got this error (along with the future warning):

/Users/imcgreg/opt/anaconda3/envs/envDiss/lib/python3.7/site-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  return _prepare_from_string(" ".join(pjargs))
Invalid input to create CRS: {'init': 'epsg:32646'}

Troubleshooting

As a base method, I tried updating conda in my environment and also updated gdal. The code then worked (albeit still giving me the FutureWarning)

/Users/imcgreg/opt/anaconda3/envs/envDiss/lib/python3.7/site-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  return _prepare_from_string(" ".join(pjargs))
Export completed to /Volumes/SEAL/IanMcGregor/planetImages/geojsons/5m/g2p13_1.geojson

This morning I tried doing the same thing by creating the shapefiles again and converting to geojson. I ran into the same invalidCRS error. This time, though, all I did was open a new terminal and try again, and it worked. I'm confused about this behavior.

I'm curious what the reason is for this. Please let me know if you'd like the full source code I'm using for the shapefiles / sample coordinates. I'm also wondering if this is an issue with my conda environment specifically but I don't think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant