1

Following is the query : C:>osm2pgsql -c --slim -d osm_1 -U postgres -H localhost -S C:\default.style C:\mumbai_india.osm.pbf

Following is the error on which i am stuck:

Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping
PREPARE get_way (int4) AS SELECT AsText(way) FROM planet_osm_point WHERE osm_id
= 1ドル;
 failed: ERROR: function astext(geometry) does not exist
LINE 1: PREPARE get_way (int4) AS SELECT AsText(way) FROM planet_osm...
 ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Error occurred, cleaning up

Following is the version of osm2pgsql:

C:\>osm2pgsql
osm2pgsql SVN version 0.69-21289M

I am using Windows 7 64bit PC with PostgreSql database installed with pgAdmin4.. I did pass various osm.pbf files in the above query but still getting the same issue. I went through various post and solutions and also created Extension postgis and Extension hstore in the database named osm_1 in pgAdmin4 postgresql but still the same issue..

I re-installed osm2pgsql with the latest version found on Google but still got the same error..

underdark
84.9k22 gold badges237 silver badges418 bronze badges
asked Sep 24, 2016 at 11:42
2
  • Osm2pgsql seems to use deprecated function. It is called ST_AsText nowadays. 900913 may lead to problems as well because it is officially 3857. Perhaps your version is oldish. Commented Sep 24, 2016 at 12:23
  • 1
    Did you add the extension Postgis to the db osm_1? Commented Sep 24, 2016 at 12:23

1 Answer 1

2

Your version of osm2pgsql is outdated, and does not respect changes that were made for Postgis 2.0

You can get the latest windows builds here: https://github.com/openstreetmap/osm2pgsql/issues/472

Alternatively (or if you run into similar problems with Mapnik), you can run the legacy.sql which brings back the old functions to Postgis 2.0: https://stackoverflow.com/questions/18945821/postgresql-install-of-legacy-sql-osm-data-and-posgis-2-0

answered Sep 24, 2016 at 16:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.