Tag Info

Hot answers tagged

6

I think you must (in addition to other scripts you've run) also run legacy.sql file which you can find next to postgis.sql and spatial_ref_sys.sql on whatever platform you are. This will add function aliases for old names because in Postgis 2.0, all functions have a 'ST_' prefix.. so AsText is now named ST_AsTexT(). Hope this helps!


6

Magnus, What are you intending to do with the OSM data once in a postgis table ? Depending on what you intend on doing with the data (Are you looking to do spatial analysis of highways ? Make a map of a complete city including restaurants and other POIs (points of interests) ? ), your osm2pgsql style files will be a little different. First, osm2pgsql's ...


6

You are not using geodesic functions to calculate the length, which means that for a point there is an error factor of: cos( LATITUDE * pi() / 180 ) If you then multiply the calculated lenght by the error factor you should obtain a value pretty close to the actual trail length. For instance the Old Beechy Rail Trail is close to Melbourne, which has a ...


6

Your computer should be fine for importing Europe. Given your dataset size and computer, I'd recommend something like this osm2pgsql -c -S /usr/share/osm2pgsql/default.style --slim -d osm-europe --flat-nodes flat-nodes.bin --number-processes 8 -C 20000 europe-latest.osm.pbf I'm assuming that you have an 8 thread CPU, if not, adjust --number-processes. ...


5

Introduction This will likely require significant amount of manually work to detect and remove the duplicated data. When you're detecting and resolving the duplicate data; you'll want both sources to be in the same geo format: shapefile, PostGIS DBs, or as OSM data. Workflow The following workflow is based on having both sources of data as OSM before ...


5

Replacing st_length with st_transform(way,4326)::geography solves the geodetic distance problem - thanks unicoletti!. Old Beechy Rail Trail | 47.2km Great Southern Rail Trail | 53.5km Ballarat-Skipton Rail Trail | 57.2km High Country Rail Trail | 63.7km East Gippsland Rail Trail | 97.6km ...


5

I imported a Planet File on a 24Gb Machine (Ubuntu Trusty) with the following .. bzcat planet-latest.osm.bz2 | osm2pgsql --verbose -U YourUser --flat-nodes flat-nodes --keep-coastlines --cache 24000 --hstore --hstore-add-index --tablespace-index pg_default --exclude-invalid-polygon --number-processes 6 --unlogged --cache-strategy dense --extra-attributes ...


5

One way of doing this, is to use a window function and partition by geometry, so that each repeated geometry gets an id: 1, 2, 3, etc (or 1, 2) in your case, and then you just select from the table where the id = 1, to get a unique set of values (attributes and geometry) back, eg, WITH unique_geoms (id, geom) as (SELECT row_number() OVER (PARTITION BY ...


5

You will have to create a new one. Nominatim requires a different database scheme than your rendering stack because it needs to perform really different queries. Using the same database for rendering and geocoding would be very inefficient, if possible at all.


4

You have to set up the database in the form osm2pgsql expects it. I have written a detailed Howto here (you might use google to translate): http://wiki.openstreetmap.org/wiki/User:Ajoessen/Postgis


4

You can find the source code of osm2pgsql here: https://github.com/openstreetmap/osm2pgsql/blob/master/reprojection.c and you will find this note in line 67: /* hard-code the source projection to be lat/lon, since OSM XML always * has coordinates in degrees. */ pj_source = pj_init_plus("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"); /* ...


4

ST_AsLatLonText documentation says: It is assumed the point is in a lat/lon projection. The X (lon) and Y (lat) coordinates are normalized in the output to the "normal" range (-180 to +180 for lon, -90 to +90 for lat). So you are seeing your point (in 900913) "wrapped" around until it eventually gets into the normal range. To see your ...


4

The difference is in the names: planet_osm_point contains point features from OSM, that is, nodes that have tags on them. Columns in both tables are tags, plus way for geometry. Planet_osm_polygon contains polygons and processed multipolygons (so you don't need to collect multipolygons yourself). So, for example, building contours would be included in ...


4

Personally, I am still using the May 2013 build of Dominik Perpeet from http://www.customdebug.com/osm2pgsql/ but the server is currently down. You can follow the latest development of the Windows build at https://github.com/openstreetmap/osm2pgsql/issues/17 The issue features three different versions, two from onepromise via ...


4

I found the solution here: http://postgis.net/docs/UpdateGeometrySRID.html --This will change the srid of the roads table to 3857 from whatever it was before UpdateGeometrySRID(varchar table_name, varchar column_name, integer srid); So for my database the table name was 'planet_osm_line' and the column that contains the srid and geometry is 'way'. the ...


4

As you query to have only nodes it is that all you get. See http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Nodes for more details. Your query should be http://overpass-api.de/api/interpreter?data=(node(52.06,5.04,52.08,5.06);<;>;);out;


3

Maybe user is reserved keyword. You may try to put username value to semicolons. Something like: psql -d mydb -c "ALTER TABLE geometry_columns OWNER TO \"user\";"


3

planet_osm_line: contains all imported ways planet_osm_point: contains all imported nodes with tags planet_osm_polygon: contains all imported polygons. Relations seem to be resolved for that. planet_osm_roads: contains a subset of planet_osm_line suitable for rendering at low zoom levels. planet_osm_line contains too many elements to render on ...


3

I ended not being able to have OpenGeo suite installed. There was a conflict with the libdal packages between OpenGeo suite, and the libgdal packages of postGIS and QGIS.


3

Just done the process for Cambridge. [This is the fastest method] Using PostGIS 2.0 (pgAdmin postgres SQL Tools 1.14) Downloaded the Cambridge OpenStreetMap data from here: http://download.geofabrik.de/osm/europe/great_britain/england/ selected Cambridge note the cambridgeshire.shp.zip 01-May-2012 06:08 11M ESRI Shapefile (EPSG:4326), zipped Loaded ...


3

The file seems to have moved. Have a look here: https://raw.github.com/openstreetmap/osm2pgsql/master/default.style


3

I had the same problem, and here is how I solved it: The problem lies in PolygonBuilder.cpp within the libgeos library. The line causing the problem has actually been fixed already, but the fix is not in the current ubuntu/debian repository that is installed via apt-get. Details of the change can be found here. I downloaded the libgeos from github and ...


3

The current osm2pgsql default.style explains in much more detail the meaning of the various flags and OsmTypes. If you're looking at writing your own style file, you should start with the empty.style example. Quoting what I wrote at the time, the five flags are polygon - Create a column for this tag, and objects the tag with are areas linear - Create a ...


3

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


3

no you dont need a server. you can install postgis on your computer and use osm2pgsql. i recommend using tilemill to create the tiles from your postgis db and use osm-bright to style them. you can then export them from tilemill in number of formats (i use mbtiles - you can open it to see the actual images if you need via mbutils) i dont know about a ...


3

No, but use can use PostGIS function ST_Length for that. It returns length in meters if way field is of geography type. That is, to get length in meters, convert it: ST_Length(ST_Transform(way, 4326)::geography).


3

If you're a very beginner you should try this tutorial of osm2po by @Underdark Osm2po will give you ready to use graph from osm data as sql script file, all you have to do is load it into database via psql -f command. In this table every single record is edge. Every edge has 2 vertices source and target - coordinations of this points are in column x1,y2 ...


3

I just found a solution. There is also an active psycop2 connection. When I commit it or close the connection before osm2pgsql runs and open it afterwards again it works. Probably osm2pgsql can't access to the database if this connection is open.


3

I ran into the same problem and I ended up using adopted way_area size clauses. By default they seemed to be too small for me. So when zooming out it would fetch so many very small polygons that that was too much data to transfer. So basically you don't display too small polygons when being zoomed out. You have to try and error until you have the best ...


3

You will find the route relations in the planet_osm_line table, with a negative osm_id field value corresponding to the OSM relation ID. Once you have loaded the table, you can set a filter on the table with rightclick on the layer entry: "osm_id" = '-51855' to get only the trail you want, and then export the result to the format you want. If you want a ...



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