Skip to content

Geoprocessing

Geoprocessing tools including:

  • merge
  • intersect
  • union
  • erase
  • clip (!!!can work with raster)
  • smc_difference
  • dissolve
  • buffer

Every tools can work with vector data.

This case study will show you Intersect tools and Clip tools

load package

import geopandas as gpd
from Godream.geobox import intersect
from Godream.plotimg import overlay_map

Intersect

First_path = "D:\DGEO\data\square.geojson"
secound_path= "D:\DGEO\data\Triangle.geojson"

# display input file on interative map
files=[First_path,secound_path]
overlay_map(files, zoom=12)
123

Using intersect function

# input path
paths=[First_path,secound_path]
out_path="D:\DGEO\data\intersect_out.geojson"

# output path
intersect(paths, out_path)

Output intersect

#display intersect result on interative map
result_files = [First_path, secound_path, out_path]

overlay_map(result_files)

123

Clip Raster by Vector

input_path='D:\DGEO\data\S2_image3.tif' # raster
clip_path = 'D:\DGEO\data\Rectan.geojson' # vector
output_path= 'D:\DGEO\data\Raster_clip.tif'

# display input file on interative map

filev = [clip_path]
filer = [input_path]

overlay_map(filev,filer)
123

Using clip function

from Godream.geobox import clip
clip(input_path,clip_path, output_path)

Output clip raster

filer = [output_path]

overlay_map(raster_file=filer, with_draw_tools=True )

123