from pprint import pprint
data = json.load(open('data.json'))
This will store the JSON data in the dictionary named data.
pprint() simply prints your data in a neat manner, preserving the indentation
I am new to geojson. Can someone please let me know how to extract co-ordinates from geojson file to python. i tried this and similar codes but received errors.
with open("pvt.dat_191022_174643.geojson") as f:
gj = geojson.load(f)
for feature in gj:
Error: Traceback (most recent call last): File "read_geojson.py", line 8, in a= feature.properties.geometry.type AttributeError: 'str' object has no attribute 'properties'
Try replacing the 6th line with the following:
a = feature.geometry.type
You could try using the AST module. ...READ MORE
Hi, nice question.
So what I daily use ...READ MORE
Hi, there is a very simple solution ...READ MORE
Hi, good question.
Let us first assume that ...READ MORE
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
can you give an example using a ...READ MORE
You can simply the built-in function in ...READ MORE
file = open('text.txt', 'w+)
Here's a generator that yields the chunks ...READ MORE
Already have an account? Sign in.