Hot answers tagged

25

For the osmosis docs, I see the command option: --bounding-box top=49.5138 left=10.9351 bottom=49.3866 right=11.201 for PostGIS you can use ST_MakeEnvelope(left, bottom, right, top, srid) to build a bounding box, then the && bounding box operator to find where the bounding boxes intersect: SELECT * FROM mytable WHERE mytable.geom && ...


7

I think it will be something like this: The bounding box in PostGIS is created by ST_GeomFromText('POLYGON((ulx uly, urx ury, llx llr, lrx lry, ulx uly))', <srid>) The query will use ST_Intersection with a subquery. SELECT bbox_nodes.id, bbox_nodes.tag, nodes_geom FROM (SELECT nodes.id, nodes.tag, ST_Intersection(nodes.the_geom, ...


7

You are using an old version of Osmosis. Since Openstreetmap has hit the line of 2^64 node numbers, all software using the data had to change node number variables from integer to long integer. If not, the software will return the error message you got. Current versions of Osmosis have fixed this problem.


6

I would simply use OGR's OSM Driver. With this script you get a list of all the street names. I just tried it with a small sample dataset. I don't know how it will perform with a bigger one. import ogr ds = ogr.Open('map.osm') layer = ds.GetLayer(1) # layer 1 for ways nameList = [] for feature in layer: if feature.GetField("highway") != None: ...


6

When creating a spatial index on a table it is important to run "vacuum analyze <table>" after that. For finding nearest points you can use operator <-> introduced in PostGIS 2.0. It actually gives you the distance between two points. More info can be found here: http://workshops.opengeo.org/postgis-intro/knn.html SELECT id FROM nodes ORDER ...


6

There's a few issues. The first one is hardware. Your drive is a WD Green drive, which is generally is about 5400 RPM which is a very slow drive, slower than typical 7200 RPM consumer drives. One of the biggest tasks in updating is fetching node positions. This is random access, which your drive sucks at. One option is to use the --flat-nodes option, ...


5

If you want to use a postgis database with Openstreetmap data, you have to populate it with osm2pgsql, not osmosis. That is the only way to get polygons out of Openstreetmap multipolygon relations and closed ways in a format that GIS software can understand. Alternatively, you can use GDAL ogr2ogr to save OSM data into a spatialite database. Once you have ...


4

there is a topic here which similar to your question here... ST_Intersection — (T) Returns a geometry that represents the shared portion of geomA and geomB. The geography implementation does a transform to geometry to do the intersection and then transform back to WGS84. 1.you can also get some information here about Geometry Constructing ...


4

Updated: OSM Reader for FME 2013 (Beta) =========================== BUILD 13082 20120417 =========================== =========================================================================== OSM reader: Updated to support reading very large datasets, for example ~764 million features on a European OSM dataset (PR#37345) ftp://ftp.safe.com/fme/beta/...


4

If you load the data into PostGIS, is there a column created for this category you mention? If so, you could use that attribute to specify the output shapefile name by setting the dynamic writer properties to use that attribute as the feature type name. Another possibility is using something like imposm.parser and Python to parse the XML file and generate ...


4

(Third try, see comments) Separate the rejects for each key, because the comma is reserved as a value separator: /path/to/osmosis.bat --read-pbf file=belgium-latest.osm.pbf --tf accept-nodes railway=station,halt --tf reject-nodes disused=* --tf reject-nodes abandoned=* --tf reject-nodes railway=disused,abandoned --tf reject-nodes station=disused --tf ...


3

Use psql to execute SQL scripts that generate schemas. You don't need osmosis to generate OSM schemas. Osmosis reads and writes from files and databases, but it does not create schamas. There's a detailed WIKI page on how to create the OSM schema and import OSM data using osmosis.


3

Overpass API allows you to extract by polygon: http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Select_Region_by_Polygon which should fill your needs. You can use QGIS to draw the desired polygon, then extract the coordinates with the MMQGIS plugin.


3

This seems to be an error with missing timestamp values in the OSM file. See http://wiki.openstreetmap.org/wiki/Talk:Osmosis#Producing_empty_timestamps . You need timestamps in the OSM XML, perhaps just fake them.


3

The plugin has issues with other version of osmosis, other than the osmosis 0.40.1 version. So whoever is using the map writer plugin for mapsforge, it is recommended that they use osmosis version 0.40.1.


3

Well this question includes multiple points that I try to answer step by step: 1. Amount of data A full planet dump is giant and will break every not well designed application. So I highly recommend to rely on existing solutions at least for filtering the full planet dump. On the other hand I don't know your exact usecase, but I'm pretty sure that you will ...


3

You cannot combine filter options (condition A && condition B). What you can do is filter in two different steps - first keep only ways satisfying the source condition and then filter the first step's result using the attribution condition. E.g.: ./bin/osmosis --rx file=ireland.osm --tf accept-ways source=* --un --wx step1.osm ./bin/osmosis --rx ...


3

Your error message is explained in another answer (the merge task can merge only two pipes, so you need two merge tasks). But there's another way to address your problem, which is to avoid merging entirely: You're filtering one tag pattern in each of three parallel pipelines, then merging those pipelines. In fact, each tag-filter task can accept more than ...


3

The best way is to use the planet.osm.pbf dump, which is a binary format and substantially faster than bzipped XML. You should also use Osmconvert instead of osmosis for a task like this. A suitable command would be osmconvert planet-latest.osm.pbf -b=10.5,49,11.5,50 -o=nuernberg.osm.pbf This will create a PBF file, which is quicker to process than ...


3

You want to use Osmosis. Example with pbf file (much much smaller - it's binary rather than text!): osmosis --read-pbf city.pbf\ --tf accept-ways cycleway=track,lane\ --used-node --write-xml citycycling.osm or with an osm XML file: osmosis --read-xml city.osm\ --tf accept-ways highway=*\ --used-node --write-xml highways....


3

The "swiss-knife" for OpenStreetMap data is osmosis. It's a command-line Java application for linux and windows. Learn-OSM provides a great introduction for new users. With osmosis you can split OSM files by a bbox, a polygon or by specific tags. Check out the latest detailed usage wiki page for more information.


3

where can I download .osm files Just go again to Geofabrik to get files with extension .osm.bz2: it's .osm files compressed using .bz2 (it's like .zip but with an alternate compression). After getting .osm.bz2, uncompress them. You will get the .osm files. is there any recommended way to convert .osm files to .xml? There are no conversion step to xml:...


3

Finding the location of your current executable can be done with which and ls -l can show you where the symlink points: which osmosis | xargs ls -l If you know the location just follow the Install instructions for pre-built binaries: wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz mkdir osmosis-new mv osmosis-latest.tgz osmosis-...


3

You need those nodes of the way to get the way geometry. OpenStreetmap does not store any vertex coordinates in the way table, only the reference to the node number. Using osm2pgsql gives you the points you want, i.e. only nodes with additional tags.


3

Using Overpass turbo or the Overpass API, you get all national cycle routes that cross the Greater London border with area["name"="Greater London"]->.boundaryarea; ( relation(area.boundaryarea)[network=ncn];>; ); out meta; Don't try the same with larger areas, it will kill your browser.


2

to do so you just have to type in console "cnf osmosis": :~> cnf osmosis Then you will receive the message whether it is installed and the path to the programme (if installed) or the repo with it (if you have repo with this software). Here is my output for example: The program 'osmosis' can be found in the following package: * osmosis [ path: /usr/...


2

I hit a lot of walls with FME too (including the RAM one despite having 36GB to play with) but typically they can be worked around. I'm not sure if there's anything specific about the OSM XML reader that requires grouping so I'll assume not. The first thing I'd suggest is read my reply here - Debugging FMW memory usage near Group-based Transformers - which ...


2

OK, I found the problem. These two files were generated by another tool. That tool assigned node and way ids within each file starting from the same default value. Therefore, there are many duplicate nodes (and ways). Based on osmosis' tie-breaking rules, I'll only get one node per id in my output file. In this case, that meant I got all the nodes/ways ...


2

I'm not exactly sure what your stack is, but I'd do this: Load extract into PostGIS using osm2pgsql Run a query like: SELECT name FROM planet_osm_line WHERE highway in ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'pedestrian', 'unclassified', 'service') (You're missing 'residential','living_street', 'track', plus all the '*_link' types, btw....


2

If you don't want ways and relations, you can use either --tf accept-nodes amenity=atm --tf reject-ways --tf reject-relations or use node-key-values: --nkv amenity=atm you should also look out for atm=yes (http://wiki.openstreetmap.org/wiki/Tag:atm%3Dyes) for cases where the machines are tagged on to the area of the building. So leaving out ways and ...



Only top voted, non community-wiki answers of a minimum length are eligible