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

Add url for water system locations #16

Merged
merged 3 commits into from Apr 15, 2019
Merged

Conversation

r-b-g-b
Copy link
Owner

@r-b-g-b r-b-g-b commented Apr 10, 2019

Note to self, here's code for converting to geojson:

# from https://stackoverflow.com/questions/43119040/shapefile-into-geojson-conversion-python-3
import shapefile
from json import dumps

# read the shapefile
reader = shapefile.Reader("my.shp")
fields = reader.fields[1:]
field_names = [field[0] for field in fields]
buffer = []
for sr in reader.shapeRecords():
   atr = dict(zip(field_names, sr.record))
   geom = sr.shape.__geo_interface__
   buffer.append(dict(type="Feature", \
    geometry=geom, properties=atr)) 

# write the GeoJSON file
geojson = open("pyshp-demo.json", "w")
geojson.write(dumps({"type": "FeatureCollection", "features": buffer}, indent=2) + "\n")
geojson.close()

@r-b-g-b r-b-g-b requested a review from skyballin April 13, 2019 01:46
@r-b-g-b
Copy link
Owner Author

r-b-g-b commented Apr 13, 2019

@skyballin Mind pulling this branch and seeing if you can run

pip install -r requirements.txt
make data

Thanks!

Copy link
Collaborator

@skyballin skyballin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From within the clean_water_tool environment, 'make data' error'ed out here:

notebook>=4.3.1->jupyterlab->-r requirements.txt (line 10)) (0.1.7)
Installing collected packages: entrypoints, pycodestyle, pyflakes, flake8, python-dotenv, src
Found existing installation: entrypoints 0.2.3
Cannot uninstall 'entrypoints'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
make: *** [requirements] Error 1

@skyballin
Copy link
Collaborator

stacks-network/stacks-core#504

Looks like a fix above

@r-b-g-b
Copy link
Owner Author

r-b-g-b commented Apr 15, 2019

Are you/can you try running this from a brand new virtualenv?

@skyballin
Copy link
Collaborator

Removed environment, tried to make create_environment and ran into this error:

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.

@r-b-g-b
Copy link
Owner Author

r-b-g-b commented Apr 15, 2019

Huh... conda update conda?

@skyballin
Copy link
Collaborator

Downgraded from Anaconda3 to Anaconda2

Ran make create_environment
All worked when doing this.

Activated clean_water_tool
Ran make data
All worked when doing this.

Pull request approved!

@skyballin skyballin merged commit df0d9dc into master Apr 15, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants