Exemple #1
0
def raster():
    return geofu.load(os.path.join(DATA, "slope.tif"))
Exemple #2
0
def lines():
    return geofu.load(os.path.join(DATA, "lines.shp"))
Exemple #3
0
def polygons():
    return geofu.load(os.path.join(DATA, "polygons.shp"))
Exemple #4
0
def points():
    return geofu.load(os.path.join(DATA, "points.shp"))
Exemple #5
0
def points_noproj():
    return geofu.load(os.path.join(DATA, "points_noproj.shp"))
Exemple #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"))
Exemple #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
Exemple #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()
Exemple #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)
Exemple #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()
Exemple #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)
Exemple #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"))