OpenStreetMap to GPS

View: New views
4 Messages — Rating Filter:   Alert me  

OpenStreetMap to GPS

by Yancho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guys,

I want to plot a list of GPS acquired locations with data originating from OpenStreetMap. I am thinking to keep everything in GPS projection since quite near in the future the project is going to be accepting live GPS readings.

OSM SRID = 900913

Should I consider GPS SRID to be: 4326?

However when I try to transform this geometry:

gis=# select astext(way), asewkt(way), st_srid(way) from malta_roads
gis-# where osm_id = 23561453;
                                                                     astext                                                                     |                                                                           asewkt                                                                           | st_srid
------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+---------
 LINESTRING(1582821.69 4304893.15,1582810.45 4304860.01,1582804.55 4304849.75,1582790.4 4304824.81,1582776.19 4304794.61,1582748.85 4304746.72) | SRID=900913;LINESTRING(1582821.69 4304893.15,1582810.45 4304860.01,1582804.55 4304849.75,1582790.4 4304824.81,1582776.19 4304794.61,1582748.85 4304746.72) |  900913
(1 row)


I get:

gis=# select astext(st_transform(way, 4326)) from malta_roads
gis-# where osm_id = 23561453;
ERROR:  transform: couldn't project point (1.58281e+06 4.30486e+06 0): failed to load NAD27-83 correction file (-38)
HINT:  PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour.
gis=#


The data in malta_roads has been acquired from OpenSreetMap in a file .osm. Data regards Maltese roads.

Thanks for your help and Happy Weekend!

--
Matthew Pulis
URL : http://www.matthewpulis.info | http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : solutions-lab.net

_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

Re: OpenStreetMap to GPS

by Greg Troxel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Matthew Pulis <mpulis@...> writes:

> I want to plot a list of GPS acquired locations with data originating from
> OpenStreetMap. I am thinking to keep everything in GPS projection since
> quite near in the future the project is going to be accepting live GPS
> readings.
>
> OSM SRID = 900913
>
> Should I consider GPS SRID to be: 4326?
>
> However when I try to transform this geometry:
>
> gis=# select astext(way), asewkt(way), st_srid(way) from malta_roads
> gis-# where osm_id = 23561453;
Have you looked at the .osm file with an editor to see what's actually
in it?

I think you'll find that the data in the osm file is actually in SRID
4326.  Certainly the osm file saved by JOSM is in this format, and also
e.g. the Massachusetts state extract of the planet file from cloudmade.

It is true that OSM uses google spherical mercator for creating map
tiles, but those are then projected coordinates rather than what appears
in the vector database.  It is of course possible that your vector file
has been pre-transformed to something unusual, but from my experience
with osm that would be somewhat odd.




_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

attachment0 (200 bytes) Download Attachment

Re: OpenStreetMap to GPS

by Emilie Laffray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matthew Pulis wrote:

> Guys,
>
> I want to plot a list of GPS acquired locations with data originating
> from OpenStreetMap. I am thinking to keep everything in GPS projection
> since quite near in the future the project is going to be accepting
> live GPS readings.
>
> OSM SRID = 900913
>
> Should I consider GPS SRID to be: 4326?
It looks like you used osm2pgsql in its default mode. If you want to
have data in 4326 with osm2pgsql, you have to use the flag -l.
The default SRID for OSM is 4326. It is only osm2pgsql that is
transforming this into 900913 for the rendering.

Emilie Laffray



_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

signature.asc (202 bytes) Download Attachment

Re: OpenStreetMap to GPS

by Yancho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks alot :) the last part of the tutorial to load the 900913.sql really wasn't useful then :) using the -l attributed helped the import to run successfully! thanks guys

On Sat, Nov 7, 2009 at 11:28 PM, Emilie Laffray <emilie.laffray@...> wrote:
Matthew Pulis wrote:
> Guys,
>
> I want to plot a list of GPS acquired locations with data originating
> from OpenStreetMap. I am thinking to keep everything in GPS projection
> since quite near in the future the project is going to be accepting
> live GPS readings.
>
> OSM SRID = 900913
>
> Should I consider GPS SRID to be: 4326?
It looks like you used osm2pgsql in its default mode. If you want to
have data in 4326 with osm2pgsql, you have to use the flag -l.
The default SRID for OSM is 4326. It is only osm2pgsql that is
transforming this into 900913 for the rendering.

Emilie Laffray


_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users




--
Matthew Pulis
URL : http://www.matthewpulis.info | http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : solutions-lab.net

_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users