All Questions
Tagged with openstreetmap postgis
388 questions
1
vote
3
answers
713
views
GeoServer WMS is slow when using OpenLayers and OSM
I am new to GIS, and attempting to create a map with PostgreSQL/PostGIS,GeoServer, OpenLayers, and OSM data.
I am only serving the NA continent, but it is taking approximately 20 seconds to render the ...
4
votes
1
answer
282
views
Creating consistent topology using PgRouting
I'm developing an application that needs routing information for certain cities. First, I downloaded a openstreetmap datafile (*.osm) and then I imported it into a PostgreSQL database using ...
9
votes
4
answers
14k
views
Unable find driver PostgreSQL in ogr2ogr
I need use ogr2ogr tool for import osm into PostgreSQL database. I've tried this command:
ogr2ogr -f PostgreSQL PG:"dbname='OSM_DB' host='localhost'
port='5432' user='postgres' password='postgres'...
1
vote
1
answer
194
views
Import all nodes that don't have tags into a PostGIS database using osm2pgsql
I want to import an OSM file into my PostGIS database using osm2pqsql. My input .osm file has around 300,000 nodes, but the planet_osm_point table ends up with only around 50,000 records. On closer ...
0
votes
1
answer
463
views
Very Slow OSM Tile Rendering
I have built my own OSM server of North America using switch2osm's Ubuntu 20.04 guide and all went well. Except when it comes to rendering tiles...or pre-rendering.
Here is the most recent completed ...
13
votes
6
answers
10k
views
PostGIS doesn't use spatial index with ST_Intersects
I imported the data from openstreetmap using osm2pgsql and copied it another table structure. If I made a query for containing rows using st_intersects, st_contain or someone else, postgis don't use ...
1
vote
1
answer
74
views
"addr:street" seems to be missing after using osm2pgsql to load data into postGIS
I have some geographic usecases for a personal usage (i.e. real-estate price forecast), and after digging through different tools, I wanted to learn more about PostGIS.
osm2pgsql seemed like a great ...
0
votes
0
answers
84
views
osm2pgsql error: Connecting to database failed (context=check)
I got this error while importing an osm file to PostgreSQL directly.
My code is:
osm2pgsql –c –d highway -U postgres –P postgres –W postgres -H localhost "D:\data\highway.osm"
The result ...
1
vote
1
answer
162
views
OSM Vector tile ST_AsMVTGeom SQL query Coordinates error
I am currently working on developing a Node.js API with Express to retrieve vector tiles from a PostGIS database.
I am using the ST_AsMVTGeom function to transform geometries into vector tiles, but I ...
10
votes
1
answer
3k
views
Conflate (merge) private shapefile data with OSM data
Background
Downloaded Alberta OSM data from Geofabrik and have it running on a private Linux server using PostgreSQL 9.1, PostGIS 2.0, Mapnik 2.1.0, osm2pgsql, Apache 2, mod_tile, renderd, and ...
1
vote
0
answers
74
views
Road data merge weather condition
I have a shapefile that shows fog, wind and precipitation values between 1 and 5. Additionally, this file consists of grids. My goal is to segment the OSM road data that fall into these grids in ...
3
votes
1
answer
143
views
Importing Overpass API response to PostGIS with ogr2ogr creates empty table
I need to import parking polygons from OSM to PostGIS. But when I import data from Overpass API using ogr2ogr it keeps creating an empty table (with the expected columns as to per osmconf.ini). Import ...
0
votes
0
answers
121
views
Uploading large OSM files to PostGIS with command line
I'm trying to upload the nationwide US OSM dataset from Geofabrik website to a PostGIS database (about 200 GB).
For small OSM files, I'm able to import the OSM file as layers into QGIS with the ...
1
vote
0
answers
110
views
Updating existing PostgreSQL database with OSM data
I currently work on the project which is directly working with the geo data of the country where I live. The database we have is quite huge, containing not only the geo data but also some other stuff. ...
0
votes
1
answer
268
views
Reorganizing OpenStreetMap into PostGIS database entity
How do I reorganize the OSM given entity to more flexible and schematic purpose?
The OSM gave 4 entities the planet_osm_line, planet_osm_point, planet_osm_polygon and planet_osm_roads.
Is there a good ...
1
vote
0
answers
61
views
Visualize a linestring and point from a PostGIS database in QGIS?
I ran a query in PostGIS table using a table of roads/linestrings in Hawaii and another table with 400,000 (longitude,latitude) points in Hawaii. The output table is meant to provide nearest road in ...
2
votes
1
answer
143
views
Query to find nearest road highway tag to a (latitude,longitude) point
I imported an OSM file for the state of Delaware into the PostGIS Database via connecting to it through QGIS. I would like to build a query to retrieve the nearest roads to the (latitude,longitude) ...
0
votes
0
answers
56
views
osm2pgsql : How to store "nd ref" data to a column in PostgreSQL/PostGIS
I'm using osm2pgql to import an OSM map. I imported it successfully but I need also the information in the "nd ref" node of the OSM XML.
I.e. my OSM XML has a node like:
<way id='1805' ...
2
votes
4
answers
6k
views
Dismissing invalid Polygons in PostGIS
I have a massive Dataset from OpenStreetMap and imported it into a PostgreSQL Database using ogr2ogr. I got several warnings during this process because of multipolygons with too little vertices. Now ...
10
votes
2
answers
4k
views
Cutting linestrings with points?
I was checking the best way to cut linestrings by points.
The scenario is: lots of streets, need the segments cut by intersect points, kind of this:
I got
linestrings (full uncuted by points) ...
0
votes
0
answers
124
views
https://vmap0.tiles not working
I am using vmap0.tiles with OpenLayers. Five months ago I could still access https://vmap0.tiles.osgeo.org/wms/vmap0? using https, but for two months it has not worked anymore.
What is wrong?
1
vote
1
answer
387
views
Query to find all buildings in area using PostGIS on OpenStreetMap database
I have a PostGIS database filled using OpenStreetMap (OSM) data of a French region.
If I made no mistake, the zone I want to investigate is bounded to the zone of the data, so I should be able to ...
2
votes
1
answer
55
views
How to only sum the bits of buildings that are actually in the given zone?
I have this query:
select sum(way_area) from planet_osm_polygon
where building<>'no' and building<>''
and way && st_transform(
st_setsrid(st_makebox2d(
...
3
votes
1
answer
104
views
Calculate the surface having a natural tag different from null
I have a PostGIS database filled with OSM data.
I would like to calculate the surface of impervious cover on a given subfraction of my database.
I have tried a more complex version of this query :
...
1
vote
0
answers
136
views
DXF to PostGIS to OpenStreetMap: coordinates are still in AutoCAD Cartesian coordinate system, not lat/long
I'm trying to take a survey site created in AutoCAD Civil 3D and export the drawing to a DXF which I then load into postgres/postgis with GDAL ogr2ogr (https://gdal.org/programs/ogr2ogr.html).
I then ...
2
votes
1
answer
173
views
Nodes returned by OSRM map match service not found in the PostGIS database
The call to OSRM map matching returns a list of nodes:
{"code":"Ok","matchings":[{"confidence":0.000854076,"geometry":{"coordinates":[[8....
3
votes
1
answer
350
views
Getting osm_id from random point with OpenStreetMap database
I've downloaded the OpenStreetMap data from GeoFabrik and imported it into PostgreSQL as described in the first procedures on this page.
The import was successful. After that, I found a way of ...
0
votes
0
answers
197
views
Correctly merge and filter GPS coordinates from LINESTRING in R's sf package
I have an SFC object with 2508 features of LINESTRING geometry type in R's sf package.
When I extract the GPS coordinates and plot them, I notice some parts of the trace are connected in the wrong ...
3
votes
1
answer
1k
views
How to add labels parallel to lines, polylines or multilines using Leaflet? [closed]
I want to add road name parallel to its line or if the line is curved, then the label should also be curved as in the image. How to add these name labels using Leaflet?
7
votes
3
answers
4k
views
Dissolve or unsplit lines on common attributes in PostGIS or GRASS? [closed]
I have a road centerline shapefile that has roads split at every intersection. However, I would like to join LINESTRINGs that have a common set of attributes into a single LINESTRING. So long as the ...
1
vote
1
answer
128
views
Local OSM server query
I need to make a query for my local OSM server which returns a table with 2 columns: user.display_name and the total of nodes of the ways with tag k='waterway' created, edited or deleted by that user.
...
2
votes
0
answers
79
views
Detect intersection nodes between different highway types
I have a postgres database with OSM data imported in it using osmosis. The import process created a ways table that has the following columns:
id | version | user_id | tstamp | changeset_id | tags | ...
1
vote
0
answers
222
views
PostGIS not using spatial index despite a pretty simple case [closed]
I have some spatial data from OpenStreetMap inside my PostgreSQL database.
I am trying to force a situation where it would use a spatial index (which exists and was created on the the_geog field, ...
1
vote
0
answers
279
views
OSM: get residentials blocks, i.e. polygons enclosed by roads
I'm trying to get a list of blocks / residential neighbourhoods via OSM. For many cities the whole town is tagged with a single landuse=residential. What I want is, for a given bounding box:
get all ...
4
votes
1
answer
725
views
Use PostGIS to get OSM tile coordinates covering a geometry linestring
I have a linestring in SRID 4326 in my table. I would like to know which tiles the linestring crosses regarding a zoom level on OpenStreetMap. The solution found here looks to come close. Use PostGIS ...
1
vote
1
answer
101
views
How to find parks using PostGIS
I have OSM data imported with osm2psql that contain 4 tables
planet_osm_line
planet_osm_point
planet_osm_polygon
planet_osm_roads
I want to pass a set of lat long to check if there is any park on the ...
0
votes
1
answer
204
views
OpenStreetMap - Overpass API; geometry disappears from node when using center
Here's my query
[out:json][timeout:25];
// gather results
(
// query part for: “building”
way["building"]({{bbox}});
relation["building"]({{bbox}});
);
// print results
out ...
4
votes
1
answer
2k
views
Get all h3 indexes within a polygon in PostGIS
Using PostgreSQL 14.5, PostGIS 3.3 and OSM data, with Uber h3 extension for PostGIS I am trying to get all hexagons within a certain boundry of polygons.
This SQL query:
SELECT h3_polygon_to_cells(...
8
votes
1
answer
7k
views
How to import country administrative boundaries from OSM Planet to PostGIS Polygons
I need to import all world countries as polygons or multipolygons into PostGIS. Specifically, I need the administrative boundaries that are like this orange bubble around the actual land borders.
I'...
15
votes
4
answers
2k
views
Adding offsets to route using pgRouting
Suppose that you're in "Point A" and want to go to "Point B". This points wouldn't be in "at_2po_4pgr" table cause aren't source/targets nodes.
Then, I would search for ...
2
votes
2
answers
1k
views
Using ST_Transform() to get the length of a LineString using SRID 4326 returning very small numbers
I am using openmaptiles to convert OSM pbf files to mbtiles. I am testing a trail that is about 5 miles in length. In doing this, I am wanting to calculate the length of path using the following:
...
0
votes
1
answer
2k
views
Get postal codes of a city in OSM via postgis/postgresql
So, I'm trying to get the postal codes of a city (polygon). Unfortunately, I never get consistent results with my code:
SELECT
a.name,
b.tags->'postal_code'
FROM planet_osm_polygon a
JOIN ...
0
votes
1
answer
226
views
Explode the "other_tags" Column of OSM Data Containing k-v Pairs in Postgis
I have a table of OSM data that includes "other_tags" column in the format like' "maxspeed"=>"90","name:en"=>"Highway H-35","ref"=>&...
5
votes
1
answer
2k
views
Convert bytea to geometry column with PostGIS
I am trying to create a geometry column from bytea.
I imported OSM data using ogr2ogr using the command
ogr2ogr -f PostgreSQL -nln bahamas_multipolygon PG:"dbname=openstreetmap user=postgres ...
4
votes
3
answers
732
views
Keeping up to date with OSM changes in pgRouting
I'm working on a routing application using OSM and pgRouting. I'm only interested in a subset of data, mostly North America (performance was difficult for large amounts of data, so don't want to use ...
3
votes
1
answer
1k
views
Use flex-output and lua style file with osm2pgsql
I want to use osm2pgsql. I have a osm.pbf file for whole Europe from geofabrik.
I am only interested in features (point and polygons) containing the tags
Religious
amenity=place_of_worship (is ...
4
votes
0
answers
173
views
Identifying U curves in route [closed]
I'm trying to identify the mountain roads in a route, and I've thought that a good approach could be get the paths with a very closed curve (like a U turn), but now I can not find any documentation ...
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 ...
1
vote
1
answer
3k
views
Building SQL query to get list of streets of city
From two layers in PostGIS (osm_places and osm_roads), I would need to have the roads belonging to a certain city.
It would be fair enough to get the street names of all streets in a radius of X ...
2
votes
2
answers
655
views
Why does Driving distance of pgRouting return disconnected results?
I am trying the driving distance function of pgRouting 2.0 beta, with an extract of OSM data.
The problem I have is illustrated on the following image :
On this picture i try to get all the ways ...