GIS newbie here! I have been playing around with the import I did from an OSM region (that I got from here) to postgres using the osm2pgsql
conversion tool. The command I used to import was this:
osm2pgsql -c -d gis --slim --style default.style -C 10240 --flat-nodes ./bayern-latest-pgsql bayern-latest.osm.pbf
Now, everything seems to have worked and I got all the data I want, except for the geometry. When I run a query like this:
> select osm_id, ST_AsGeoJSON(way), name, from planet_osm_point;
I get back values like {"type":"Point","coordinates":[1197606.06200162,6136808.52532997]}
in the st_asgeojson
column. These coordinates are not what I expected (lat, lon). What am I doing wrong here?
--latlong
flag on theosm2pgsql
tool (which I didn't use), perhaps that's the reason?Using projection SRS 3857 (Spherical Mercator)
Output after--latlong
is:Using projection SRS 4326 (Latlong)