New answers tagged

3

Read the documentation of VRT https://gdal.org/drivers/raster/vrt.html and add color table. Step by step example: Create test image with gdal_create https://gdal.org/programs/gdal_create.html#gdal-create. Utility is included in GDAL version 3.2 and higher. gdal_create -of GTiff -outsize 10 10 -bands 1 -burn 2 -ot Float32 float_gray.tif Create a VRT from ...


0

import shapefile import csv import ast with open(r"Sample_Data.csv", encoding="utf8") as csvfile: # dict create dictReader=csv.DictReader(csvfile) # create writable shapefile w = shapefile.Writer('Sample_Data.shp') # create attribute w.field('id', 'C') w.field('nieghborho', 'C') w.field('plan_no', 'C') #...


0

The easiest way of rasterizing that shapefile's biome field to a global raster longlat layer of a 1 x 1 degree resolution is probably the following: # Load packages packs <- list("tidyverse", "raster", "sf", "fasterize") lapply(packs, require, character.only = T) # Load shapefile wwf_shp <- st_read("C:/...


4

Each of you geometries is within a list, so you are effectively passing a list of lists as a geometry to GeoDataFrame. You have to pass a list-like of geometries, not lists. Using apply you can get the actual geometry out of the list. b = gpd.GeoDataFrame(a[['a', 'b']], geometry=a['c'].apply(lambda x: x[0])


0

The query below creates a linestring from the multilinestring provied. select st_astext(st_makeline(geom)) from ST_Dump(ST_GeomFromText('MULTILINESTRING((-3.16420835153456 55.9269166007097,-3.164222 55.926918),(-3.1642070167833 55.9269296196706,-3.16421351659546 55.9268662214904), (-3.16421351659546 55.9268662214904,-3.16421636372824 55.9268384509897),(-3....


1

Easy Python solution for you. Only requires the installation of GeoPandas. Just substitute your filepaths and run this script. import geopandas inputFile = '/home/lpowalka/Documents/dane/prg/Województwa_pop.shp' outputFile = '/home/lpowalka/Documents/dane/prg/Województwa_pop_new.shp' df = geopandas.read_file(inputFile) zfactor = 0.3048 df.geometry = df....


0

Thanks @Johan, your code is very usefully. I need to find the EPSG id for utm zone, given latitude and longitude : import math # Special zones for Svalbard and Norway def getZones(longitude, latitude) : if (latitude >= 72.0 and latitude < 84.0 ) : if (longitude >= 0.0 and longitude < 9.0) : return 31 ...


Top 50 recent answers are included