0

I'm trying to convert the Nielsen map of DMAs from a JSON to a shapefile. The properties of the json is as formatted like this:

  "id": 546,
          "properties": {
            "name": "dma:",
            "latitude": 33.896366,
            "tvperc": 88.6,
            "dma": 546,
            "dma1": "Columbia, SC",
            "cableperc": 50.5,
            "adsperc": 38.8,
            "longitude": -80.9102195

However, when I drag the json to QGIS, the ID and the name column are the only thing that are retained. Similarly, when I try to convert this to a shapefile through ogr2ogr, the same thing occurs. Is there a way I can keep the properties? I know I can use the -select parameter but there are no examples on how to use this anywhere in the documentation. My code is below.

ogr2ogr -f "ESRI Shapefile" nielsentopo.json "usa-dma.shp"
  • You need a GeoJSON format – gene Jun 2 '15 at 17:54
  • Ahh gotcha, is there anyway I can do that? Much of the discussion is converting geoJSON to topoJSON and not the other way around. Thanks! – Minh Mai Jun 2 '15 at 19:53
4

First convert the Nielsen data from topojson to geojson. One way to do this is with this online topojson to geojson tool.

From there, copy and save the resulting geojson to a new file, then you can convert to shapefile, etc.

ogr2ogr -f "ESRI Shapefile" output.shp input.geo.json 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.