Skip to content

Instantly share code, notes, and snippets.

@runa
Created September 16, 2013 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runa/6579246 to your computer and use it in GitHub Desktop.
Save runa/6579246 to your computer and use it in GitHub Desktop.
Usando este dataset http://data.buenosaires.gob.ar/dataset/barrios/resource/0bb5510f-bbbf-471c-a758-849f3656fb70 (barrios.shp)
y con esta linea de ogr2ogr:
`ogr2ogr -t_srs EPSG:4326 -f GeoJSON barrios.json barrios.shp`
me genera un barrios.json
```json
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "BARRIO": "CHACARITA", "COMUNA": 15.0, "PERIMETRO": 7725.695227704650279, "AREA": 3118100.972396453842521 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -58.45406447495408, 0.033388785715681 ], [ -58.454752713418195, 0.032819955992301 ], [ -58.454845208610038, 0.03274117797875 ], [ -58.454885491164767, 0.032706840282306 ], [ -58.455691839320643, 0.032020444475712 ],
}]}
```
la latitud esta bien (-58.45406447495408), pero la longitud (0.033388785715681) esta en una unidad desconocida. porque?
@runa
Copy link
Author

runa commented Sep 16, 2013

ok, ok, al reves: la longitud esta bien pero la latitud no!

@davo
Copy link

davo commented Sep 16, 2013

Cómo hiciste al final?

@jkutianski
Copy link

El SHP de BAdata esta en coordenadas cartesianas ya que esta reproyectado en GKBA http://spatialreference.org/ref/sr-org/7433/, tenes que poner la proyeccion del origen para poder reproyectar en WGS84. Para la proxima usa lo siguiente:
ogr2ogr -f "GeoJSON" -t_srs wgs84 -s_srs "+proj=tmerc +lat_0=-34.629269 +lon_0=-58.4633 +k=0.9999980000000001 +x_0=100000 +y_0=100000 +ellps=intl +units=m +no_defs" destino.json origen.shp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment