[Talk-us-massachusetts] MassGIS Parcels, importing into postgis?

Greg Troxel gdt at lexort.com
Thu Sep 5 23:17:15 UTC 2024


This is more abusing a local geonerd list than osm, although I expect to
use this data for OSM editing, or at least finding things that maybe
should be different.

I'm trying to get parcel data into postgis so I can view it in qgis.

I downloaded the statewide geodatabase from

  https://www.mass.gov/info-details/massgis-data-property-tax-parcels

I am importing into postgis as

  #!/bin/sh

  GDB_LAYERS="L3_LUT L3_UC_LUT L3_ASSESS L3_MISC_POLY L3_OTHLEG_POLY L3_PARCEL_FTP_LINKS L3_TOWNFY L3_TAXPAR_POLY"
  VIEW_LAYERS="L3_TAXPAR_OWNER"

  for layer in $GDB_LAYERS; do
      echo "LAYER: $layer"
      psql -c "DROP TABLE $layer;"
      ogr2ogr -f PostgreSQL PG:dbname=gdt  -t_srs "EPSG:6319" MassGIS_L3_Parcels.gdb $layer
  done

(and then will need to join TAXPAR_POLY and ASSESS on LOC_ID).

Running this blows up:

  LAYER: L3_LUT
  DROP TABLE
  LAYER: L3_UC_LUT
  DROP TABLE
  LAYER: L3_ASSESS
  DROP TABLE
  LAYER: L3_MISC_POLY
  ERROR:  table "l3_misc_poly" does not exist
  Warning 1: Geometry to be inserted is of type Multi Surface, whereas the layer geometry type is Multi Polygon.
  Insertion is likely to fail
  Warning 1: organizePolygons() received a polygon with more than 100 parts.  The processing may be really slow.  You can skip the processing by setting METHOD=SKIP.
  ERROR 1: COPY statement failed.
  ERROR:  Geometry type (MultiSurface) does not match column type (MultiPolygon)
  CONTEXT:  COPY l3_misc_poly, line 235, column shape: "010C000020AF18000001000000010A00000001000000010900000005000000010800000003000000DDE57CEA7BCF51C061AE..."

  ERROR 1: ERROR:  current transaction is aborted, commands ignored until end of transaction block

and indeed MassGIS documents that these have polygons/multipolygons, not
these newfangled MultiSurface things.

ogrinfo shows

  FID Column = OBJECTID
  Geometry Column = SHAPE
  MAP_PAR_ID: String (26.0)
  LOC_ID: String (18.0)
  POLY_TYPE: String (15.0)
  MAP_NO: String (4.0)
  SOURCE: String (15.0) NOT NULL DEFAULT 'ASSESS'
  PLAN_ID: String (40.0)
  LAST_EDIT: Integer (0.0)
  BND_CHK: String (2.0)
  NO_MATCH: String (1.0) NOT NULL DEFAULT 'N'
  TOWN_ID: Integer(Int16) (0.0)
  SITE: String (80.0)
  ESN: Integer(Int16) (0.0)
  LU_CODES: String (60.0)
  DEV: String (1.0)
  SYM1: Integer(Int16) (0.0)
  SYM2: Integer(Int16) (0.0)
  SHAPE_Length: Real (0.0)
  SHAPE_Area: Real (0.0)

so perhaps my problem is not setting the layer type.


If anyone has any clues, I'd appreciate them -- trying to understand
better before writing to MassGIS.



More information about the Talk-us-massachusetts mailing list