This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir utf8 | |
export SHAPE_ENCODING="latin6" | |
echo "Converting to geojson..." | |
for i in *.shp | |
do | |
f=$(echo $i| cut -d'.' -f 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ogr2ogr n50_hoydetall_buffer.sh n50_hoydetall.shp n50_hoydetall -dialect sqlite -sql "SELECT ST_Buffer( geometry , 5 ), * FROM 'n50_hoydetall' " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ogr2ogr centroid.shp fields.shp -dialect sqlite -sql "SELECT ST_Centroid(geometry), id, name from fields" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: sh terraintextureshading.sh demfile newname resolution XMIN YMIN XMAX YMAX | |
# example: sh terraintextureshading.sh mydem.tif sylarna 4 XMIN YMIN XMAX YMAX | |
i="$1" | |
f="$2" | |
j="$3" | |
XMIN="$4" | |
YMIN="$5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# kan köras på både väg-, översikt- och terrängkartan. | |
for name in "jl" "vl" | |
do | |
# välj ut linjer som är tunnlar (gäller vl och jl) | |
ogr2ogr -sql "SELECT * FROM $name WHERE KKOD IN (5811, 5812, 5816, 5817, 5821, 5822, 5824, 5825, 5828, 5829, 5832, 5833, 5834, 5836, 5840, 5844, 5845, 5851, 5856, 5858, 5861, 5871, 5882, 5891, 291, 286, 292, 293, 294, 295, 296, 299, 5552, 5432, 5332, 5322, 5312, 5232, 5222, 5212, 5112, 5012, 5612, 5613, 5622, 5623, 5632, 5642, 5643)" ${name}_underfart.shp $name.shp | |
# lägg till kolumn för vinkel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
name="$1" | |
ogr2ogr -sql "SELECT * FROM $name WHERE (KATEGORI LIKE '%underfart%' OR KATEGORI LIKE '%tunnel%')" underfart.shp $name.shp | |
ogrinfo underfart.shp -sql "ALTER TABLE underfart ADD COLUMN angle integer(3)" | |
ogrinfo underfart.shp -dialect SQLite -sql "UPDATE underfart SET angle = (atan((ST_X(ST_StartPoint(geometry))-ST_X(ST_EndPoint(geometry)))/(ST_Y(ST_StartPoint(geometry))-ST_Y(ST_EndPoint(geometry))))) * 180/3.14159 + (180 *(((ST_Y(ST_StartPoint(geometry))-ST_Y(ST_EndPoint(geometry))) < 0) + (((ST_X(ST_StartPoint(geometry))-ST_X(ST_EndPoint(geometry))) < 0 AND (ST_Y(ST_StartPoint(geometry)) - ST_Y(ST_EndPoint(geometry))) >0)*2)))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage sh merge_datasets.sh pathtofolderincludingslash [merge] | |
# example: sh merge_datasets.sh /Volumes/Calazoskar/Geodata/Terrängkartan/skridskokartan/ merge | |
# when merging | |
mypath="$1" | |
merging="$2" | |
if [ $merging == "merge" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Help: put clip_shape_folder.sh in the same catalog of you shape files. Go to Terminal. | |
# Usage: sh clip_shape_folder.sh XMIN YMIN XMAX YMAX name | |
XMIN="$1" | |
YMIN="$2" | |
XMAX="$3" | |
YMAX="$4" | |
NAME="$5" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder