No subject


Mon Mar 16 11:32:08 PDT 2009


> Never worked with osm data, but since I created the .prj generator in
> pgsql2shp, I can tell you it reads the srid of the geometry and looks up =
the

> srtext in spatial ref and outputs that to the .prj file.

> I suspect osm data is in Mercator not long lat.  If you want your output =
to
> be in long lat, you need to transform and use an sql statement

> pgsql2shp -f "/path/to/filename" -h myserver -u apguser -P apgpassword
> mygisdb=20
> =09"SELECT field1 AS hs_num, field2...., ST_Transform(the_geom,4326) As
> the_geom FROM planet_osm_line"

I tried what u said as follows:
______________________________________________
pgsql2shp -f ../data/myfile gis "SELECT *, ST_Transform(way,4326) As the_ge=
om FROM planet_osm_line"

Output:

Preparing table for user query... Failed: ERROR:  AddToPROJ4SRSCache: Canno=
t find SRID (4326) in spatial_ref_sys

______________________________________________

Then With reference to this http://postgis.refractions.net/pipermail/postgi=
s-users/2008-February/018486.html web=20
page I executed the following in the postgres database

______________________________________________
gis=3D# SELECT UpdateGeometrySRID ('public', 'planet_osm_polygon','way', 42=
36);

Output:

ERROR:  constraint "enforce_srid_way" of relation "planet_osm_polygon" does=
 not exist
CONTEXT:  SQL statement "ALTER TABLE public.planet_osm_polygon DROP constra=
int enforce_srid_way"
PL/pgSQL function "updategeometrysrid" line 53 at EXECUTE statement
SQL statement "SELECT UpdateGeometrySRID('', $1 , $2 , $3 , $4 )"
PL/pgSQL function "updategeometrysrid" line 4 at SQL statement
______________________________________________

I don't know what to do now, please guide !

--=20
Regards,
Anisha Kaul

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India