Tag Info

New answers tagged

0

Ok. Since apparently nobody knows how to do this, I wrote a small nodejs program that performs the task: tags2nodes. You have to specify the osm input file, the relation you want to filter, the postgres user and db data and the program creates a table to store the ouput nodes with 3 columns: id, tags, and geometry. In the column tags (json stringified by ...


1

Your problem is the -W argument in your prompt. This argument does not take any input, but forces a prompt for the postgres user's password. So to solve your problem remove postgres after the -W argument. osm2pgsql -cGsW -d osm -U postgres -H localhost -S /usr/local/share/osm2pgsql/default.style /Users/asmaa/SIG/Projet_SIG/campus.osm


1

First of all, ST_Distance_Sphere returns in meters, so you are actually looking at 8km, which might be more reasonable. I suspect, also, that you have you lat/lon the wrong way round -- your point is somewhere off the coast of the Seychelles, not Carlisle, and there are not too many roads in the Indian Ocean. Also, while the query planner will optimize this ...


0

If you want a little more control and a little more SQL: UPDATE TABLE foo SET geom = ST_TRANSFORM(geom, 3857); The command updates the geom geometry column of your table foo with a geometry with transformed SRID.


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


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.


2

Create hstore extension in your PostGIS database run SQL query "CREATE EXTENSION hstore" and enable hstore option in osm2pgsql import command adding key "--hstore"


3

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


0

There are several ways: http://taginfo.openstreetmap.org already provides this kind of data for the complete OSM data set the tool osmfilter can be used with the parameter --out-count or --out-key to get this data from your OSM data file. you can configure the .style file to just store any tag present in the data set using Postgres' hstore feature. This ...


0

After I created a symbolic link: ln -s /opt/bitnami/postgresql/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 It is working fine. It seems that osm2pgsql only looks for the socket at /var/run/postgresql/.s.PGSQL.5432. My question is related to this one here: http://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432



Top 50 recent answers are included