Skip to content

Instantly share code, notes, and snippets.

@jazzido
Last active November 15, 2016 00:10
Show Gist options
  • Select an option

  • Save jazzido/23c81fc446d79aa2ee1e340b0a3ca25c to your computer and use it in GitHub Desktop.

Select an option

Save jazzido/23c81fc446d79aa2ee1e340b0a3ca25c to your computer and use it in GitHub Desktop.
Convirtiendo CSVs geográficos de datos.gba.gob.ar a formatos apropiados

Los datasets con información geográfica publicados en http://datos.gba.gob.ar están formato CSV. Para poder usarlos hace falta convertirlos a un formato apropiado. Tomando como ejemplo el dataset Recorrido de colectivos de líneas provinciales:

  1. Renombrar el CSV al nombre cole.csv.

  2. Crear un archivo input.vrt con este contenido

    <OGRVRTDataSource>
       <OGRVRTLayer name="cole">
            <SrcDataSource>cole.csv</SrcDataSource>
            <GeometryType>wkbLineString</GeometryType>
            <LayerSRS>WGS84</LayerSRS>
            <GeometryField encoding="WKT" field="WKT" />
        </OGRVRTLayer>
    </OGRVRTDataSource>
  3. Correr el comando ogr2ogr -f GeoJSON colectivos.json input.vrt

Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment