Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5870 closed defect (fixed)

Topojson driver not reading all feature attributes

Reported by: springmeyer Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description

It appears that TopoJSON support is lacking handling for feature attributes? I'm not familiar enough with the TopoJSON spec to know if something changed, but here is a testfile that leaflet/github renders with attributes but ogrinfo does not: https://github.com/ohsk/topojson-shp-testing/blob/master/json/tl_2010_us-hawi_WGS84.json

I get only id and name showing up in the attributes and not fields like tract, gid, state, etc:

ERROR 4: GeoJSON Driver doesn't support update.
Had to open data source read-only.
INFO: Open of `/Users/dane/projects/mapnik/3.x/hawaii.topojson'
      using driver `GeoJSON' successful.

Layer name: tl_2010_us-hawi_WGS84
Geometry: Unknown (any)
Feature Count: 326
Extent: (-178.309703, 18.910690) - (-154.806622, 28.402182)
Layer SRS WKT:
(unknown)
id: String (0.0)
name: String (0.0)

Downstream issue: https://github.com/mapbox/mapbox-studio/issues/1220

Change History (3)

comment:1 Changed 7 years ago by Even Rouault

"id" and "name" are currently hardcoded in the driver. I don't recall the reason. Probably because it was based from examples with those attributes or early spec? I can see the spec at https://github.com/topojson/topojson-specification allows for arbitrary attributes like GeoJSON.

comment:2 Changed 7 years ago by Even Rouault

Component: defaultOGR_SF
Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r28618 "TopoJSON: establish layer schema from objects properties, instead of the 2 only hardcoded id and name attributes (#5870)"

comment:3 Changed 6 years ago by Even Rouault

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.