Oh my gosh, I found the error, I can't believe it.

The problem was the insert command for adding srid 900913, in my insert
from my own written documentation there was a break after

+units=m

Now after removing the break the projection works as expected.



Ric S schrieb:
> Unfortunately I still have problems with my setup. I have now setup a
> new db in the following way:
>
> createuser geouser
> createdb -E UTF8 -O geouser gis
> createlang plpgsql gis
> psql -d gis -f/usr/share/pgsql/postgresql/contrib/lwpostgis.sql
> echo "ALTER TABLE geometry_columns OWNER TO fas; ALTER TABLE
> spatial_ref_sys OWNER TO geouser;"  | psql -d gis
>
> psql -d gis -f/usr/share/doc/postgis-1.3.2/spatial_ref_sys.sql
>
> then added srid 900913:
>
> INSERT into spatial_ref_sys (srid, auth_name, auth_srid, srtext,
> proj4text) values (900913 ,'EPSG',900913,'GEOGCS["WGS 84", DATUM["World
> Geodetic System
> 1984", SPHEROID["WGS 84", 6378137.0,
> 298.257223563,AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich", 0.0,
> AUTHORITY["EPSG","8901"]], NIT["degree",0.017453292519943295],
> AXIS["Longitude", EAST], AXIS["Latitude",
> NORTH],AUTHORITY["EPSG","4326"]],
> PROJECTION["Mercator_1SP"],PARAMETER["semi_minor", 6378137.0],
> PARAMETER["latitude_of_origin",0.0], PARAMETER["central_meridian", 0.0],
> PARAMETER["scale_factor",1.0], PARAMETER["false_easting", 0.0],
> PARAMETER["false_northing", 0.0],UNIT["m", 1.0], AXIS["x", EAST],
> AXIS["y", NORTH],AUTHORITY["EPSG","900913"]] |','+proj=merc +a=6378137
> +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m
> +nadgri...@null +no_defs');
>
> compiled the latest osm2pgsql from trunk and inserted the data:
>
> ./osm2pgsql -m -d gis germany.osm.bz2
>
> At work I'm using postgres 8.1 on RHEL. At home I use postgres 8.3 on
> Suse 11.0.
>
> I have no clue what could be wrong here?
>
>
> Ric S schrieb:
>   
>> Hi folks,
>>
>> I just tested the select on my dev machine at home and there it produces
>> the right output.
>> So it is obvious that my db at work is not correctly setup. I'm just
>> going to clean my db and import the latest data.
>>
>> Thanks again for all the help.
>>
>> Cheers Ric
>>
>>
>> Rahkonen Jukka schrieb:
>>   
>>     
>>> Hi,
>>>
>>> There should be no problem in this.  I do regularly update the whole OSM 
>>> data from Finland to epsg:2393 inside PostGIS with  transform and never 
>>> faced a problem. Reasons I can imagine are
>>>
>>> - the Ingolstadt point is in a wrong place in OSM database
>>> - PostGIS has wrong parameters for either source or target projection. 
>>> Really hard to believe that 4326 could be the problematic one.  Check what 
>>> projection your OSM data has in the database and projection string that is 
>>> stored for that in PostGIS coordinate system table.  You may also try to 
>>> import OSM data again with osm2pgsql by using some other option for the 
>>> projection.  If epsg:4326 is your goal you can import data directly to that.
>>>
>>> -Jukka Rahkonen-
>>>
>>>   
>>>     
>>>       
>>>> -----Alkuperäinen viesti-----
>>>> Lähettäjä: [email protected] 
>>>> [mailto:[email protected]] Puolesta Ric S
>>>> Lähetetty: 26. helmikuuta 2009 15:07
>>>> Vastaanottaja: Mapnik users mailing-list
>>>> Aihe: [Mapnik-users] OT: Openstreetmap projection
>>>>
>>>> Hi Folks,
>>>>
>>>> this is a little bit offtopic, but I think someone here might 
>>>> know the solution.
>>>> I'm trying to transform osm data from my postgis db to lat lon values.
>>>>
>>>>  SELECT name, place, asText(transform(way,4326)) from 
>>>> planet_osm_point WHERE name = 'Ingolstadt' AND place = 'city' 
>>>> ORDER BY name;
>>>>
>>>> The result is:
>>>>
>>>> 11.4333         48.9570163662354
>>>>
>>>> If I use the values for example with google maps the 
>>>> resulting point is off by about 20km.  The expected result 
>>>> would be rather around 11.41 48.76.
>>>>
>>>> Any clue what's wrong?
>>>>
>>>> Thanks Ric
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Mapnik-users mailing list
>>>> [email protected]
>>>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>>>>
>>>>     
>>>>       
>>>>         
>>>   
>>>     
>>>       
>> _______________________________________________
>> Mapnik-users mailing list
>> [email protected]
>> https://lists.berlios.de/mailman/listinfo/mapnik-users
>>
>>   
>>     
>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
>   

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to