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:
WHERE mytable.geom && ...
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, ...
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,
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.
ds = ogr.Open('map.osm')
layer = ds.GetLayer(1) # layer 1 for ways
nameList = 
for feature in layer:
if feature.GetField("highway") != None:
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.
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://postgis.net/workshops/postgis-intro/knn.html
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 ...
Overpass API allows you to extract by polygon:
which should fill your needs.
You can use QGIS to draw the desired polygon, then extract the coordinates with the MMQGIS plugin.
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
1.you can also get some information here about Geometry Constructing ...
(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 ...
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 ...
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:
mv osmosis-latest.tgz osmosis-...
OSM usually doesn't contain the exact outline of a junction or intersection (except in very few cases where area:highway has been mapped) and most roads don't have a width set.
However you can try to estimate it by looking at the highway class (i.e. primary, secondary, tertiary...) and the number of lanes.
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)
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 ...
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 ...
With osm2pgsql, you have to edit the default.style file.
it is a simple text file, so any text editor will do.
For including lanes, add a line
node,way lane text linear
you have to re-import your data afterwards.
If you have installed the hstore, you could extract the tags from there, but that's a bit more difficult.
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: ...
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.
I'm not exactly sure what your stack is, but I'd do this:
Load extract into PostGIS using osm2pgsql
Run a query like:
WHERE highway in ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'pedestrian', 'unclassified', 'service')
(You're missing 'residential','living_street', 'track', plus all the '*_link' types, btw.)
When creating the database you want to apply the osmosis/script/pgsnapshot_schema_0.6_linestring.sql script before importing. This will cause osmosis to generate the linestrings. If you didn't do this before importing, it's possible to add a linestring column and use the SQL in the bulk load script to populate it, but this is very slow when operating on a ...
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.
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.
Converting OSM to PBF is probably not necessary, most tools that can read PBFs can also read OSM XML.
If you do need to read the file with osmosis, the issue here is that ogr2osm by default generates files that can be loaded in JOSM and merged with existing OSM data. These files have no timestamp or version attributes as well as having negative IDs, while ...
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 ...
According to this thread in OSM forum you can try (next to osmosis) further tools like osmconvert or OSM History splitter
The documentation about osmconvert tells that you can use bbopx data or polygon files (maybe as square polygons?) to get single files.
In case of doubt, tell us more about your special aim of splitting boundaries or number of output ...
Osmosis is the swiss-knife for OSM data and therefore a great piece of software to handle OSM data. I'd recommend to follow the steps below to succesfully import OSM data into a PostGIS database in a windows environment:
First of all you need to download and install PostgreSQL with a PostGIS extension and download the latest stable version of osmosis.
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....