Tag Info

Hot answers tagged

13

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 && ...


6

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, ...


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 ...


5

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.


5

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: ...


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) ...


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 ...


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

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

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

(Third try) Separate the rejects for each key, because the comma is reserved as a value separator: D:\Karten\OpenStreetMap\osmosis\bin\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 ...


2

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 ...


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: ...


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

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, ...


2

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.


2

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.


2

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.


2

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 ...


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 ...


2

--write-pgsql wants to talk to a Postgis database. You have not specified any database connection for that task, e.g.: osmosis --read-pbf file=switzerland.pbf --tf accept-nodes shop=supermarket --write-pgsql host=128.178.12.34 database=myDatabase user=myUsername password=myPassword Furthermore, keep in mind that restaurants can also be modelled as closed ...


2

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, ...


1

Try this post: How to manage the osmosis command line? Pay attention to comments where I solved some troubles. Here I have some tricks too: How to extract primary and secondary roads from OSM data?


1

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 ...


1

The default.style file has this annotation: There are some special database columns that if present in the .style file will be populated by osm2pgsql. These are osm_user, osm_uid, osm_version, osm_timestamp - datatype text. Used with the --extra-attributes option to include metadata in the database. If importing with both --hstore and ...


1

I have no idea what "osmosis" is, but in general you can deal with this by: SETting search_path before running your CREATE statements Explicitly schema-qualifying your objects, eg gis.mytable, not mytable ALTER USER ... SET search_path = 'gis, public' on the user ID in use ALTER DATABASE ... SET search_path 'gis, public' on the database in use


1

There might be a problem with your osmosis command, specially that you say you get different results when you change the order. How did you write that? You don't necessarily have to merge those two files to import both in your database. Import the first one, and for the second, use OSM2PGSQL --append switch to append it to the current database. If you ...


1

Firstly, you can download OSM extracts that are already filtered by country/region/city directly from CloudMade: http://downloads.cloudmade.com/ Secondly, the reason your command isn't working is because osm2pgsql requires a filename to be passed in. On Linux you would use /dev/stdin (and this is what the osm2pgsql docs tell you to do) but it looks like ...


1

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 ...



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