All Questions
Tagged with openstreetmap postgis
388 questions
0
votes
0
answers
131
views
How to export GeoJSON from PostGIS with "id" property?
Let's say I'm exporting features from my PostGIS DB like so:
SELECT ST_AsGeoJSON(*)::jsonb
FROM planet_osm_line
WHERE [conditions]
What I'm trying to achieve here is to include the "id" property ...
2
votes
1
answer
582
views
How to increase a PostGIS query efficiency when querying OSM information
I have this SQL query to get roads from my PostGIS server.
WITH boxed_roads AS
(SELECT * FROM "planet_osm_line"
WHERE ST_Within(way, ST_MakeEnvelope(xmax ,xmin, ymax, ymin, 4326))
)
SELECT ...
0
votes
1
answer
360
views
Making lines from nodes using OpenStreetMap and PostGIS (+ TileMill)
using openstreetmap data (in a postgis database), I would like to highlight all roads with a certain surface tag in tilemill.
I can query for the tag, doing
SELECT * FROM planet_osm_ways WHERE '...
0
votes
0
answers
681
views
Extremely slow Nominatim install with Docker
I am trying to install Nominatim based off of a dockerized version of the tool found here: https://github.com/mediagis/nominatim-docker. I was successful with installing dockerised Nominatim with a ...
2
votes
1
answer
2k
views
OSM + PostgreSQL Queries
I'm newbie to PostGIS and am looking for some SQL examples for better understanding.
I didn't understand how do I manipulate the tables, how objects relate one to another. An example:
There is this ...
0
votes
0
answers
774
views
Get Corresponding OSM Node IDS from list of Lat,Long (CSV): Map Matching
I have a list of (lat,lng) coordinates. I want to map match them and get their corresponding OSM node ids? How can i do that using OSRM or any other map matching algorithm?
0
votes
0
answers
304
views
{'code': 'NoMatch'} OSRM API: What does it mean? And how can I avoid it?
I have RAW GPS trackers data, when I match those GPS coordinates to nearest NodeID, it gives me the No Match Error. I am using the following code snippet:
import requests
url = 'http://router....
3
votes
3
answers
275
views
Intersecting Polygons to Build Boundary Hierearchy using PostGIS
I have a set of polygons that are stored flat in a table (these are OSM admin boundaries extracted through Osmium and osm2pgsql). Each polygon has one record for it. However, these polygons form ...
1
vote
1
answer
162
views
Osmosis failed: ERROR: relation "pend_ways" does not exist
I tried to generate osm update using osmosis and osmium(omsium only for setting configuration.txt from existing russia-latest.osm.pbf).
I use osmosis like that:
osm2pgsql -append --slim --cache ...
1
vote
1
answer
2k
views
Adding local map as background to dbeaver spatial viewer in offline computer
I'm using DBeaver (which is a universal database manager) to connect to a Postgis database on a offline computer (not connected to internet).
The spatial viewer of DBeaver uses Leaflet to display ...
2
votes
1
answer
258
views
Lossless import of full OpenStreetMap planet dump into PostGIS
I would like to import a full OpenStreetMap planet dump as PBF into a PostGIS tables.
With tools like osm2pgsql or imposm3, configuration files are neccessary. Unfortunately, it is not possible to ...
2
votes
2
answers
779
views
How to get distance between a point and a list of highways?
I'm new to GIS. I'm trying to determine whether a list of GPS points are within a highway/road (in terms of meters). I have downloaded a OSM file and populated my database using osm2pgsql.
I have the ...
2
votes
0
answers
69
views
Find polygons which are intersecting / touches with defined polygon [closed]
I have a polygon and I would like to find all polygons from the table planet_osm_polygon which my polygon lies in or touches. I tried to use st_intersects function but it doesn't work as I would ...
1
vote
1
answer
209
views
Unexpected problem with some CSS styles on GeoServer for OSM data [closed]
My layerset went wrong after mapproxy caching. Some layers are not rendering, and one of them shows this error message when I want to watch a preview:
<ServiceException>The requested Style can ...
0
votes
3
answers
466
views
Splitting Streets to Create Polygons?
I have a need to take all the streets belonging to a certain area (in OpenStreetMap) and split each street by each other and form polygons from the segments that result from the split operation. I do ...
2
votes
1
answer
677
views
Unclosed linestring to polygon works with QGIS but not with PostGIS
Just like the title, I am extracting OSM riverbank and a lot of riverbanks in OSM is in 'unclosed' linestring.
This is the original river shape i extracted from OSM
In order to polygonize the ...
2
votes
0
answers
352
views
Combine data of OSM roads into longer lines using PostGIS
For my vector map I'd love to display highways at a quite early zoom level. The problem is that this data would be quite big, so I thought I simply ST_Simplify it. The problem though is that the OSM ...
3
votes
1
answer
440
views
How to set schema parameter in osm2pgsql calling
How I can to set schema name parameter when call osm2pgsql?
For example:
osm2pgsql --create -s -C 2500 -G -S D:\default.style -d osm_db -o input -U osm_user -W -H localhost -r pbf D:\osm.pbf
I set ...
2
votes
1
answer
848
views
Improving Mapnik render time
I'm adding polylines (elevation curves) to a world map. Said polylines are stored in a PostgreSQL database from gdal_contour tool. The geometry columns (LineString, 3857) has a GIST index and a ...
1
vote
1
answer
435
views
GIST index not used by query optimizer on geometry field
I'm trying to add elevation curves on an OpenStreetMap tile server I'm currently building.
I created a table in PostgreSQL to store the shapes of the whole world.
Structure was defined by gdal_contour ...
1
vote
0
answers
279
views
Map Matching between two geometry (line string)
I have two tables in PostGIS, both having line string as the geometry type. I wanted to extract a similar or exact matching street. Can you please suggest query or algorithm for it?
Table 1
column ...
0
votes
1
answer
497
views
How can I find a postal_code for a given Lat/Lon in a OSM database?
I have a OSM database on postgres/postGIS. Data are downloaded from https://download.geofabrik.de/ and created in postgres with osm2pgsql using schema osm2pgsql.
Now I'm looking for a postalcode on a ...
6
votes
1
answer
1k
views
Create a line string from street geometry
I'm currently facing some hard times trying to create a simplified line from a street geometry.
The data that I'm currently using comes from OpenStreetMap, using osm2pgsql.(Which means PostGIS, but I'...
1
vote
0
answers
631
views
Extracting all cities from a state using PostGIS
I have written a PostGIS query on a database with OSM data of the state of Baden-Württemberg.
SELECT *
FROM public.planet_osm_polygon
WHERE boundary = 'administrative'
AND admin_level = '8';
So ...
2
votes
2
answers
3k
views
Size expectations of OSM in PostGIS
I've got a PostGIS database that's been loaded with a couple of the continent downloads from geofabrik. One of these continents is Antartica - the pbf download is 29 MB but the size in the database ...
0
votes
0
answers
222
views
Matching streets in two line datasets with PostGIS or QGIS?
Explanation:
I have 2 tables on PostgreSQL, one table named 'city' that have linestrings wich represents streets from a city (using QGIS I downloaded OpenStreetMaps data and imported to PostgreSQL ...
1
vote
1
answer
368
views
Creating osm2pgsql hstore tags using PostGIS column
This is the opposite question to this one: Creating columns in PostGIS using osm2pgsql hstore tags
First, I changed default.style to make separate 'lanes' column. Then I extracted osm database ...
4
votes
2
answers
1k
views
OSM Line 'way' from PostgreSQL (PostGIS) to Java Linestring (from JTS library)
I would like to read the data from PostGIS OSM database to Java object. I have 'planet_osm_line' table. I'd like to get 'osm_id' and 'way' column read by ResultSet, as here:
stmt = con....
3
votes
0
answers
364
views
Dealing with bridges over roads in PostGIS topology?
first time posting please ask for more details if not enough provided.
I am using OSM road data and have created postgres topology for them. I am now cleaning up the data before exporting it for ...
1
vote
1
answer
563
views
Find polygon boundary dynamically based on a point (lat/long) having type farmland using OSM
There are many ways to retrieve the polygon information when you know that the information is already present somewhere (data locally or in database containing extracted info about polygon). But this ...
1
vote
2
answers
174
views
Ring geometries in pgRouting OSM DUMP
After performing pgRouting's "pgr_analyzeGraph" algorithm, over an Open Street Map dump uploaded to my PostGIS DB, I get this output, by I can't figure out what "ring geometries" are. Does somebod ...
0
votes
0
answers
90
views
osm2pgsql stops after importing several extracts
I want to import several city extracts from the bbike website into my postgis database. I use windows on a desktop pc with 16GB RAM and a quadcore processor. The first couple of extracts imported ...
5
votes
2
answers
195
views
osm2pgrouting creates erroneous roads
osm2pgrouting works without giving any errors but most of the roads have lost their geometry.
Result is ;
What I've done so far;
OSM Data downloaded from http://download.geofabrik.de/ in pbf ...
2
votes
1
answer
208
views
finding isolated rings in postgis
I want to find the isolated rings in an OSM dump loaded into PostGIS, using pgRouting. I need to do this in order to delete the isolated rings of the network. Does anyone know how to do it?
1
vote
1
answer
305
views
Re-sync OSM DB After Failure
I extract highways from OSM every day from a cron job and keep a postgis database up-to-date. Due to a database change, the syncing has stopped in December 2017. I am trying to re-sync with a sequence ...
0
votes
1
answer
257
views
Qgis Server Error while rendering postgis osm layer planet_osm_polygon
I have hosted QGIS server on a remote server. I want to publish OSM layer which is stored in PostgreSQL database. I have prepared one project file with .qgis extension and copied to the desired ...
0
votes
1
answer
340
views
Angle of elevation using coordinates
I'm currently using an OSM dataset of San Francisco and I want to calculate the angle of elevation of each road segment using x and y coordinates given by this dataset.
I used this formula and I get ...
1
vote
1
answer
475
views
How to import OSM relations to PostgreSQL databases? [closed]
I have created PostgreSQL databases using Osm2pgsql. I have all the lines and points data.
How can I import the relations stored in OSM file? for example turn restriction?
Is there an easy way to ...
3
votes
1
answer
2k
views
What is the correct way to get road segments from OSM based on a route?
I'm using a Postgresql+postgis database with OSM data (just the Netherlands). I would like to get a list of all road segments based on a set of LAT/LONG coordinates.
For my test I use (part of) a ...
0
votes
1
answer
70
views
Ambiguous values on OSM to calculate optimal path: Which value should I use?
I'm using San Francisco OSM dataset, I want to calculate the optimal path using pgrouting(pgr_astar)
The problem that I don't know which column should I use?
For example:
I want to calculate the ...
1
vote
1
answer
392
views
For each row of GPS coordinates, get value from nearest road to coordinates and copy to said row using PostGIS? [closed]
I have two tables in my database; one contains a set of GPS coordinates of a car which have been converted to geom, and another containing Open Street Map road data, including the speed limit for most ...
0
votes
1
answer
98
views
Retrieving lat long coordinates in Cartesian circle
I'm using an OpenStreetMaps database to render a map using leaflet.js. Leaflet has the ability to draw a circle on the map and I would like that circle to be used to drive the measurements used to ...
2
votes
0
answers
128
views
Convert OSM data to PostGIS polygons in .net?
I'm trying to obtain data from OSM and store it to a PostgreSQL + PostGIS database, with certain modifications to adapt to our tables.
Is there any built way to convert OSM relations/ways/nodes into ...
2
votes
0
answers
693
views
import *.osm.bz2 to postgresql using OSMOSIS causes errors
I am trying to import osm.bz2 flie from http://download.geofabrik.de/.
I think I am almost there though somehow my CMD returns error messages
I downloaded osmosis-latest file from http://bretth.dev....
2
votes
0
answers
264
views
Merge ("dissolve") OSM LineStrings from GeoJSON with ST_UNION
I would like to merge the continuous LineStrings from a GeoJSON export of an OpenStreetMap relation (get from Overpass Turbo):
"geometry": {
"type": "LineString",
"coordinates": [
In ...
1
vote
1
answer
795
views
Extract geometries from bounding box (within and overlapping) and copy results to new empty database
I am new to PostgreSQL and GIS.
I do have a downloaded dump of OSM data (map of Germany) available, which was imported via osm2pgsql into a PostGIS-enabled PostgreSQL database germanyPG.
The query
...
1
vote
1
answer
379
views
How to designate unique destination table names in OSM import to PostGIS using ogr2ogr
I download country cuts of OSM from GeoFabrik. When I import a country's PBF file into my PostGIS instance using ogr2ogr, it simply gives me a generically named set of tables (lines, points, ...
0
votes
1
answer
356
views
ST_AsGeoJSON providing unexpected values
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:
...
5
votes
1
answer
538
views
OSM2PGSQL - Openstreetmap Tiles showing no detail at certain levels
I recently built myself a Map server using this guide:
https://www.linuxbabe.com/linux-server/openstreetmap-tile-server-ubuntu-16-04
This has worked really well to an extent.
I have however noticed ...
1
vote
1
answer
592
views
Removing water from OpenStreetMap polygons?
I have a full OSM import using non-customized osm2pgsql (slim). I need to remove all coastal water from the polygons requested by the user on the fly.
I have imported all water from osm water ...