Code Monkey home page Code Monkey logo

pdok-attribute-mapper's Introduction

pdok-attribute-mapper

Scripts for renaming of attributes of geospatial files. It is a wrapper script around the GDAL/OGR ogr2ogr command line utility. To rename attributes, supply the following positional arguments:

  • <input_file>: input file that needs attribute renaming
  • <output_gpkg>: output GeoPackage with renamed attributes
  • <mapping>: mapping file with each line containing: ${old_attribute_name}\t${new_attribute_name}, see the example folder. Every attribute of the input file needs to mapped, otherwise the attribute will be omitted in the output GeoPackage
  • <layer_name>: target layer in the input file
  • <optional:ogr-arguments>: pass optional arguments for ogr2ogr, for example set the new layer name in the output GeoPackage -nln new_layer_name

For example:

./map-attributes.sh /vsizip/example/sample_shape.zip sample_shape sample.gpkg example/mapping.txt -nln new_layer_name

Depedencies

Requires GDAL/OGR to be installed and the ogr2ogr command line utility needs to be available in the $PATH (environment variable), see gdal.org.

Usage

Batch script (Windows)

map-attributes.bat /vsizip/example/CBS_PC4_2015_v2.zip CBS_PC4_2015_v2 CBS_PC4_2015_v2.gpkg --output-gpkg 

Bash script (Linux)

./map-attributes.sh /vsizip/example/sample_shape.zip sample_shape sample.gpkg example/mapping.txt

pdok-attribute-mapper's People

Contributors

arbakker avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.