Skip to content

Python port of an extension to GeoJSON that encodes topology

License

Notifications You must be signed in to change notification settings

osgn/python-topojson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PYTHON-TOPOJSON

Port of topojson, originally ported by @calvinmetcalf, licensed under the same BSD license as the original.

Installation:

pip install git+https://github.com/osgn/python-topojson.git

Current usage:

input can be a file-like object, a path to a file, or a dict, output can be a path or a file-like object, if omitted a dict is returned

current tested options are quantization and simplify.

from topojson import topojson
#give it a path in and out
topojson(inPath,outPath, quantization=1e6, simplify=0.0001)

can also go the other way.

from topojson import geojson
geojson(topojson,input_name=None,out_geojson=None)

topojson may be a dict, a path, or a file like object, input_name is a string and if omited the first object in topojson.objects is used, geojson may be a file like object or a path if omitied the dict is returned

known issues:

  • coding style only a mother could love
  • holds everything in memory, this could be bad
  • should be able to incrementally add features to a topojson object

About

Python port of an extension to GeoJSON that encodes topology

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages