Skip to content

Instantly share code, notes, and snippets.

@sandra-granular
Last active April 28, 2016 23:10
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 sandra-granular/c5009e189d842ddf72878c41df77e03c to your computer and use it in GitHub Desktop.
Save sandra-granular/c5009e189d842ddf72878c41df77e03c to your computer and use it in GitHub Desktop.
import os
from pyspatial import read_geojson
base = os.path.abspath(os.path.dirname(__file__)) # path to 'pyspatial/test/'
get_path = lambda x: os.path.join(base, "data/vector", x)
with open(get_path('shape.json')) as f:
shape = f.read()
shape = read_geojson(shape)
with open(get_path('point.json')) as f:
point = f.read()
point = read_geojson(point)
shape[0][0].Intersection(point[0][0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment