Getting ready

To get started, perform the following steps:

  1. Be sure that you have PostGIS topology support enabled in your database instance. This support is packaged as a separate extension and, if you are using PostgreSQL 9.1 or newer versions, you can install it using the following SQL CREATE EXTENSION command:
      postgis_cookbook=# CREATE EXTENSION postgis_topology;
  1. Download the administrative area archive for Hungary from the gadm.org website at http://gadm.org/country (or use the copy included in the code bundle provided with this book).
  2. Extract the HUN_adm1.shp shapefile from the archive to your working directory, working/chp03.

 

  1. Import the shapefile to PostGIS using a tool such as ogr2ogr or shp2pgsql, as follows:
      ogr2ogr -f ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.