ogr2ogr output_dissolved.shp forest_VGS.shp -dialect sqlite -sql “SELECT ST_Union(geometry) AS geometry FROM forest_VGS”
Continue reading..GDAL: Dissolve All PolygonsI had been referencing stops from the original north shore geology field trip guide, until I found an updated version of the guide in a book (embedded below p.132-144)! In this chapter, he lists the military grid reference system (MGRS) coordinates (Green 2011) so I entered them into a spreadsheet. I then downloaded it as […]
Continue reading..Weekend GIS Fun: Part 3long-billed murrelet
Continue reading..St. Louis Co., MN Rare Birds – Nov.The best solution I found was to chop up the state by county, crop the raster brick to that extent, and import it as a velox object. Then, I used velox extract to get the values.
Continue reading..Best Approach for Large Area Zonal StatsI’m getting this error after a 137 /panfs/roc/msisoft/R/3.6.0/lib64/R/bin/BATCH: line 60: 30473 Killed ${R_HOME}/bin/R -f ${in} ${opts} ${R_BATCH_OPTIONS} > ${out} 2>&1 It ends on this line… fr <- sapply(1:nrow(forest),function(y) fasterize(forest[y,], cr[[1]])) Since smaller memory processes run without error, I can only assume that storing a vector of larger cropped rasters is the problem. So, onto a […]
Continue reading..Latest ErrorSome common, useful formats for storing this type of information… CSV GeoJSON/TopoJSON GML KML MySQL/SQLite/SpatiaLite/PostGIS NetCDF SVG VRT ESRI shape file ESRI feature class It can also be advantageous to abstract data in memory to work with it. I had never heard of GMT or VPF until now but I’m curious about them! A colleague […]
Continue reading..Best Practices for Big Polygon Data SetsI’m working with a colleague on processing a raster, in order to define patches by connectivity rules. The input raster was a habitat suitability model, where… 1 = suitable habitat 0 = unsuitable habitat 255 = background “no data” value So, we needed to ultimately make the “1s” into patches. To do this, we needed […]
Continue reading..GDAL Warp AdventureI needed to merge a bunch of shape files into one. These files were all in a folder, but each shape file was in a separate sub-folder. So I copied them all into a folder together to merge them. First I navigated to the folder that had all the sub folders, and then I ran… […]
Continue reading..Linux + GDAL TricksFrom the COSEWIC report (direct quotes): Yellow Rails have such a narrow tolerance of water levels for breeding that any given location may be suitable in one year but not the next, especially in prairie regions, where the species mainly occurs in seasonal wetlands (Prescott et al. 2003). An occupied marsh in southern Manitoba was partly destroyed […]
Continue reading..Yellow Rail Notes#!/bin/bash for VARIABLE in ./test_export/*.tif; do gdal_translate -of GTiff -a_nodata 0 “$VARIABLE” “PPR_no/$(basename “$VARIABLE” .tif).tif” gdal_sieve.py -st 2 -8 “PPR_no/$(basename “$VARIABLE” .tif).tif” gdal_polygonize.py -8 “PPR_no/$(basename “$VARIABLE” .tif).tif” -f “ESRI Shapefile” “shapefile/$(basename “$VARIABLE” .tif).shp” rm “PPR_no/$(basename “$VARIABLE” .tif).tif” ogr2ogr -f “ESRI Shapefile” -progress “shapefiles/$(basename “$VARIABLE” .tif).shp” “shapefile/$(basename “$VARIABLE” .tif).shp” -t_srs “EPSG:5070” done listofmodisdays=`ls shapefiles/*.shp | cut […]
Continue reading..GDAL Polygonize in Action!