New answers tagged

2

Download administrative boundaries of the spain and portugal from in .shp format from http://www.gadm.org/ you can import the shapefiles into QGIS or another software the filter with query builder to isolate the regions you are interested in QGIS you can install openlayer plugin from the vectors tab select- openstreetmap then select download data points, ...


2

The best way to get boundaries of countries, provinces and regions is to use the OSM Boundaries application: https://osm.wno-edv-service.de/boundaries/ Extracting boundaries from generic tools like Overpass Turbo is not always easy, as the boundaries may contain errors and are likely complex multipolygons consisting of many parts. The OSM Boundaries ...


1

You could download data directly from Openstreetmap as .osm file, and convert it in QGIS as .kml, since QGIS supports export data as .kml. Alternatively, you could download data from Geofabrik (also openstreeet map data, but country by country, as .gbd/mdb, and in ArcMap, export it as .kml. Also, I would suggest you to use, if you have, shapefiles od Spain ...


2

The easiest way to get OpenStreetMap extracts would probably be through Mapzen's Metro Extracts tool here I would suggest exporting it in GeoJSON, then using a tool like ogr2gre (there's an online version here) to convert it to KML. You may also be interested in looking at Overpass Turbo for exporting data from OpenStreetMap.


1

Altough I wasn't able to find a bug in the above code... I managed to work it around using another way to load GeoJSON based layers. Another thing, the lat and longs weren't properly ordered in the example given (so that the correspond to positions on Rosario, Argentina)... Below are written correctly. <!DOCTYPE html> <html> <head> ...


5

If you have imported a planet or extract some time ago and have now downloaded a (much) newer planet or extract: It does not really make sense to do any updating as I think calculating and applying the diff will not save you time. Just re-run osm2pgsql again and it will remove the tables and create new ones resulting in updated data. If you want to keep ...


0

You have not written what you want to do with the stops or why you want to know which stop belongs to which route. This might influence what the best solution to your problem is. The data you need is in the DB. If we look at Relation 1658527 as example you get the routes out of planet_osm_line by looking for osm_id -1658527. The information about the stops ...


0

Just a guess but it seems like Nominatim doesn't know/support all language codes at the moment. However you can access node 244082315 directly via the OSM API.


4

Since nodes like speed_camera are always attached to a street ... So you mean that a node with tagging for a speed camera is always a child element of a street that it belongs to? Are you sure? According to the OSM wiki about Relation:enforcement a speed camera can also be next to the belonging street. The connection is done via a so called Relation in ...


0

Take the link from iant's comment and click on details. On the database side, Nominatim calculates an address hierarchy. It does this by looking at address tags on the object, associatedStreet relation on the object if present, boundary relations containing the object in question, and places containing the object or being near it. And maybe more. More ...


0

I realized that it is possible to cast from the Geometry object to the Geography object using the SQLAlchemy function, despite the two not being native SQLAlchemy objects. query = session.query(Route).filter(func.ST_Distance(cast(Route.way,Geography),'SRID=4326;POINT(10.71223 47.69716)') < distance )


0

taginfo counts 104000 nodes and 206000 ways tagged with leisure=playground. That is not a very huge amount of data, but you should query both data types. It would be best to prefetch them, put them in an extra database, and let the users query that online. You could build centroids on the closed ways to reduce the data amount. If the data can be "a few days ...


0

In Mapnik rendering size is controlled by the scale factor configuration setting. From https://github.com/mapnik/mapnik/wiki/Scale-factor: For example, most Mapnik stylesheets are designed with normal, moderate resolution computer displays in mind. For print graphics or for more modern and high resolution displays like on many mobile devices existing ...


0

If your route.way is already in WGS84, EPSG:4326, then casting should be possible. I have not used GeoAlchemy2 but based on your syntax it should be: query = session.query(Route).filter(func.ST_Distance(Route.way::geography,ST_GeomFromText('POINT(10.71223 47.69716)',4326)::geography) < distance


1

probably you are not entering correct password. Please make sure you can access db from pgAdmin. Then use same user/password (copy&paste).


0

It depends on the data in the graph file. In order to include or exclude road types modify the osm2po.config file. See this thread. It's a similar question for bike routing But dont use maxSpeedOverrides anymore, it's deprecated in newer versions of osm2po.


3

Indeed, the default.config is very strict and to be honest it's too strict for my taste. I stumbled across a similar question weeks ago and modified the osm2po release notes for 5.1.0 to report this issue. Your solution above is correct. But I think there are not so many more positive tags, It would be shorter to modify the deny-option instead to sth. like ...


4

Ok, I am sorry about me answering my own question. I guess I had to ask the question to think about it more and be able resolve the problem. It turns out the problem was not in the OSM data but with the osm2po default config file I use to generate the graph. The problem Somewhere (line 188, if you are using osm2po 5.1.8) in the default config file, there ...


1

The geojson layer is in EPSG:4326, not 3857. For the center_coord, you should reproject the degree values to EPSG:900913: new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());


0

This looks like a projection issue. Your GeoJSON is showing units in degrees longitude and latitude: {"type":"MultiPoint", "coordinates":[[-33.015055,-60.655964],[-32.940781,-60.636731],[-32.917201,-60.683852]] }; The default GeoJSON CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of ...


0

osm2shp.ru here you can download openstreetmap data in shapefiles format. Data divided by regions: North and South America, Australia and Oceania, Africa, Europa and Asia.61 layers for download. Data filtered by "Map Features" conditions.


2

Save AS ... the kml file as a shapefile into a CRS that uses meters as units, like your local UTM zone. Then you can use the $length variable to label the line with the length in the layers units.


0

My solution to the problem would be: Open your kml file with a text editor (notepad for instance) Copy the entire text, and paste it here : http://www.zonums.com/online/kmlArea/ Done!


2

You can change the appearance in JOSM via styles. There are already various different styles available. Alternatively you can create your own style. This affects only the map rendering in JOSM of course.


0

In pgRouting the the shortest path function(s) return the route with the lowest cost between two points. If your cost attribute is "time", then your shortest path will be the quickest route. I recommend you to start with the pgRouting workshop, which explains about variable costs as well: http://workshop.pgrouting.org/chapters/advanced.html


1

If you want a basemap with tiles, you need to render them yourself with Mapnik, Maperitive, TileMill or else. Depending on the extent of your area, you will get billions of tiles, mostly filled with ocean water. This is definitely not a task for Openlayers javascript. The OSMXML function might be useful to overlay some POI from the Openstreetmap database, ...


3

I would stick to the OSM design as close as possible. It works pretty well accross most zoom levels. I use #787878 for the base colour. Width 1mm. For the dashed line on top I use white as colour. Width 0.6mm. Cap style Square. Custom Dash 1.5mm (Space 3).


1

As you discovered, osm2pgsql and osm2pgrouting are not the tools to use. These tools create dedicated spatial schema's and actually convert the raw data (especially in the case of osm2pgsql and its support for creating PostGIS multipolygons), instead of giving you the 'raw' data to do your own processing on. I think for your particular use case, you should ...


1

I found a solution using a transform method with a jar http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/current-SNAPSHOT/onebusaway-gtfs-transformer-cli.html#Merge_Trips_and_Refactor_Calendar_Entries


3

Check the instructions from Underdark about using OSM data (same as Stamen uses) with some style files she has made (see below for links) These have completely changed print cartography for us - we're doing both 36x24" plots and static images with the OSM lines styled with the 'Google' / colour version, and a black and white style I modified (I should ...


0

I don't know if you found out what the problem was but in my case it was that the /usr/local/etc/renderd.conf file was wrongfully configurated. That tutorial says to put this: plugins_dir=/usr/lib/mapnik/input but it should be: plugins_dir=/usr/local/lib/mapnik/input local is missing.


0

Since you downloaded the OSM data I would suggest you convert it to GeoJSON, so you can work with Turf.js, which accepts GeoJSON as input data. To convert data to GeoJSON you can work with different tools, such as geojson.io or QGIS. Once everything is in GeoJSON you can use turf.nearest (documentation and example). Since you are probably testing a point ...



Top 50 recent answers are included