2

I have a file, Council_Districts.topojson, with the following structure:

{ type: 'Topology', arcs: [...], transform: {...}, objects: {
  Council_Districts_2016: {
    type: 'GeometryCollection',
    geometries: [
      {
        arcs: [...],
        type: '...',
        properties: {
          'DISTRICT': 0,
          'ID': 0,
          'OBJECTID': 0,
        }
      },
      ...
    ]    
  }
}

I also have a `Sample_Data.csv' file with the following structure:

DISTRICT, varA, varB, ....,
0, .1, .2, ...

I'm looking to combine these two files such that my output file has the following structure:

{ type: 'Topology', arcs: [...], transform: {...}, objects: {
  Council_Districts_2016: {
    type: 'GeometryCollection',
    geometries: [
      {
        arcs: [...],
        type: '...',
        properties: {
          'DISTRICT': 0,
          'ID': 0,
          'OBJECTID': 0,
          'varA': .1,
          'varB': .2,
        }
      },
      ...
    ]
  }    
}

Googling around, I'm finding the previous answer has been to use the external properties flag on the topojson cli, e.g. topojson -e blah, but this flag does not seem to be available within the current topojson 2.0

  • I also cannot find the flag in the new API – gregmacfarlane Aug 23 '17 at 14:44
-1

Use QGIS to convert your CSV to GeoJSON then upload your GeoJSON to MapShaper.org or geojson.io and download as other formats they support, like TopoJSON.

  • He's asking how to join a CSV file to an existing topojson, not how to create a topojson. – gregmacfarlane Aug 23 '17 at 14:44

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.