Skip to content

Instantly share code, notes, and snippets.

@frewsxcv
Created January 19, 2014 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frewsxcv/20b6522d8242ede00bb3 to your computer and use it in GitHub Desktop.
Save frewsxcv/20b6522d8242ede00bb3 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ingriddiniz
Copy link

import json

Criar um objeto GeoJSON com uma "linestring"

geojson = {
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[0, 0],
[1, 1],
[2, 2]
]
},
"properties": {
"color": "red" # Definir a cor como "red"
}
}

Converter o objeto GeoJSON em uma string JSON

geojson_str = json.dumps(geojson)

Exibir o GeoJSON resultante

print(geojson_str)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment