예제 #1
0
############
#SETUP
############
#setup rendering options
geovis.SetRenderingOptions(renderer="aggdraw",
                           numpyspeed=True,
                           reducevectors=False)
#create map
geovis.SetMapBackground(geovis.Color("blue", brightness=0.9))
geovis.SetMapZoom(x2x=[0, 180], y2y=[0, 90])
newmap = geovis.NewMap()

############
#LOAD AND SYMBOLIZE LAYERS
############
countrylayer = geovis.Layer(
    filepath=r"D:\Test Data\necountries\necountries.shp")
countrylayer.AddClassification(symboltype="fillcolor",
                               valuefield="pop_est",
                               symbolrange=[
                                   geovis.Color("white"),
                                   geovis.Color("red",
                                                intensity=0.9,
                                                brightness=0.8),
                                   geovis.Color("red",
                                                intensity=0.9,
                                                brightness=0.5)
                               ],
                               classifytype="natural breaks",
                               nrclasses=3)
countrylayer.AddClassification(symboltype="outlinewidth",
                               valuefield="pop_est",
예제 #2
0
#importing geovis from temporary location
TEMP_GEOVIS_FOLDER = r"C:\Users\BIGKIMO\Documents\GitHub\geovis"
import sys
sys.path.append(TEMP_GEOVIS_FOLDER)
import geovis

#setting up for speed
geovis.SetRenderingOptions(reducevectors=True)

#create map
MAPCOLORSTYLE = "pastelle"
geovis.SetMapBackground(geovis.Color("blue", style=MAPCOLORSTYLE))
newmap = geovis.NewMap()

#add base shapefile layer
base_layer = geovis.Layer("D:\Test Data\Global Subadmins\gadm2.shp")
newmap.AddToMap(base_layer)

#overlay with a folder of many shapefiles
for eachfolder, eachfile, eachext in geovis.ShapefileFolder(
        r"D:\Test Data\DHS GPS"):
    eachlayer = geovis.Layer(filepath=eachfolder + eachfile + eachext,
                             fillcolor=geovis.Color("random",
                                                    style=MAPCOLORSTYLE))
    newmap.AddToMap(eachlayer)

#add title
newmap.AddText(relx=0.5, rely=0.1, text="Batch Map Example", textsize=0.06)

#finally view the map
newmap.ViewMap()
예제 #3
0
#SETUP
############
#set rendering options
geovis.SetRenderingOptions(renderer="aggdraw",
                           numpyspeed=True,
                           reducevectors=False)
#create map
geovis.SetMapBackground(geovis.Color("blue", brightness=0.9))
geovis.SetMapZoom(x2x=[-120, 40], y2y=[-60, 20])
newmap = geovis.NewMap()

############
#LOAD AND SYMBOLIZE LAYERS
############
countrylayer = geovis.Layer(
    filepath=r"D:\Test Data\necountries\necountries.shp",
    fillcolor=geovis.Color("yellow", brightness=0.8))
pointlayer = geovis.Layer(filepath=r"D:\Test Data\GTD_Georef\gtd_georef.shp",
                          symbolizer="square")
pointlayer.AddClassification(symboltype="fillcolor",
                             valuefield="nwound",
                             symbolrange=[
                                 geovis.Color("white"),
                                 geovis.Color("red",
                                              intensity=0.9,
                                              brightness=0.9),
                                 geovis.Color("red",
                                              intensity=0.9,
                                              brightness=0.5)
                             ],
                             classifytype="natural breaks",