I can read this file if I first convert to geojson using the command
line converter:
$ topojson-geojson topo_wpc.json
which gives me wpc.json, and then in R:
d=readOGR("./wpc.json","OGRGeoJSON")
OGR data source with driver: GeoJSON
Source: "./wpc.json", layer: "OGRGeoJSON"
with 632 features and 3 fields
Feature type: wkbPolygon with 2 dimensions
Hmmmm
Barry
On Sun, May 10, 2015 at 6:38 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
On Sun, 10 May 2015, Barry Rowlingson wrote:
On Sun, May 10, 2015 at 4:31 PM, Daniel Marcelino <dmarcelino at live.com>
wrote:
Dear all, I'm having the following issue when trying to read a
topographical json file:
That's a **topological** (not topographical) geojson file. Instead
of recording each polygon separately, and thus duplicating common
boundaries, a topojson file stores all the line segments once, and
then defines polygons as which sequence of line segments draws the
polygon.
I'm guessing your ogr library doesn't have topojson support. Does the
output of ogrDrivers() agree with me?
Solution is usually "use gdal/ogr tools to convert to plain old
geojson (ogr2ogr)"
Right, but while the geojson driver does read topojson from 1.11, ogrinfo
says no-go. On inspecting the file, it appears only to contain lost of links
to other stuff and no geometries that I (or OGR) recognise. The geometries
must be hidden in one of the links, but are not exposed.
Roger