Esempio n. 1
0
def raster():
    return geofu.load(os.path.join(DATA, "slope.tif"))
Esempio n. 2
0
def lines():
    return geofu.load(os.path.join(DATA, "lines.shp"))
Esempio n. 3
0
def polygons():
    return geofu.load(os.path.join(DATA, "polygons.shp"))
Esempio n. 4
0
def points():
    return geofu.load(os.path.join(DATA, "points.shp"))
Esempio n. 5
0
def points_noproj():
    return geofu.load(os.path.join(DATA, "points_noproj.shp"))
Esempio n. 6
0
def test_load_nonexistent():
    DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
    with pytest.raises(IOError):
        d = geofu.load(os.path.join(DATA, "THISFILEDOESNOTEXISTANYWHERE.shp"))
Esempio n. 7
0
from geofu import load

d1 = load("test_data/union_test/states.shp")
d2 = load("test_data/testname_buffer.shp")

d12 = d1.intersection(d2)
d12.render_png(show=True)
print d12

d12 = d1.identity(d2)
d12.render_png(show=True)
print d12

d12 = d1.union(d2)
d12.render_png(show=True)
print d12
Esempio n. 8
0
import geofu

pts = geofu.load("test_data/at_shelters.shp")

# what's out coordinate reference system
print pts.crs

# reproject to US National Atlas
#pts = pts.reproject(2163)

ptbuff = pts.buffer(0.4)
print ptbuff

import sys
sys.exit()

# buffer by 5km
ptbuff = pts.buffer(5000)

# use the mapfart.com web service to render it
ptbuff.mapfart(show=True)

# Get it as a fiona collection
print type(ptbuff.collection())

# let's examine the geojson string
print ptbuff.geojson(indent=2)[:200]

# And use geojsonlint.com to validate it
print "Is this geojson valid?", ptbuff.validate_geojson()
Esempio n. 9
0
from geofu import load
print load("../test_data/at_shelters.shp")\
    .reproject(2163).buffer(21000).reproject(4326)\
    .save("../test_data/woot.shp")\
    .render_png(show=True)
Esempio n. 10
0
import geofu

pts = geofu.load("test_data/at_shelters.shp")

# what's out coordinate reference system
print pts.crs

# reproject to US National Atlas
#pts = pts.reproject(2163)

ptbuff = pts.buffer(0.4)
print ptbuff


import sys
sys.exit()

# buffer by 5km
ptbuff = pts.buffer(5000)

# use the mapfart.com web service to render it
ptbuff.mapfart(show=True)

# Get it as a fiona collection
print type(ptbuff.collection())

# let's examine the geojson string
print ptbuff.geojson(indent=2)[:200]

# And use geojsonlint.com to validate it
print "Is this geojson valid?", ptbuff.validate_geojson()
Esempio n. 11
0
import geofu

d = geofu.load("test_data/states.shp")

#d = d.reproject(2163)
d = d.simplify(0.1)

print d.render_png(show=True)
Esempio n. 12
0
def test_load_nonexistent():
    DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
    with pytest.raises(IOError):
        d = geofu.load(os.path.join(DATA, "THISFILEDOESNOTEXISTANYWHERE.shp"))