NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I need to extract all cities with lat lon coords from Slovakia OSM.

This is how I imported OSM file downloaded from Geofabrik:

osm2pgsql --slim --username postgres --database gis --hstore slovakia-latest.osm
psql -U postgres -d gis
CREATE EXTENSION hstore;

Import went without errors.

What SELECT query should be to see 3 tables (city, latitude, longitude)?

asked 03 Jun '21, 18:10

akulin's gravatar image

akulin
21336
accept rate: 0%


SELECT name, st_astext(st_transform(way, 4326)) FROM planet_osm_point WHERE place='city' OR place='town' ORDER BY name;
permanent link

answered 21 Sep '21, 16:04

akulin's gravatar image

akulin
21336
accept rate: 0%

edited 22 Sep '21, 11:35

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×165
×134
×107

question asked: 03 Jun '21, 18:10

question was seen: 1,094 times

last updated: 22 Sep '21, 11:35

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum