[ gpsdrive ] Mapnik Projection used by gpsdrive
Jan-Benedict Glaw
jbglaw at lug-owl.de
Fri Sep 26 09:27:27 AKDT 2008
On Thu, 2008-09-25 10:01:25 +0200, Guenther Meyer <d.s.e at sordidmusic.com> wrote:
> Am Dienstag 23 September 2008 schrieb Jan-Benedict Glaw:
> > > that's right.
> > > but it's not a good solution to use a fixed projection. who knows how
> > > often they will change it?
> >
> > Nobody, unfortunately.
> >
> > > so the best way is to read the projection from the database, if possible,
> > > or to store it somewhere on database creation.
> >
> > A quick look at the osm2pgsql code tells me that this isn't stored
> > anywhere, but I may be wrong. Though, it probably would be nice to add
> > another table with at least the used SRS, or even the whole projection
> > string.
>
> shouldn't have postgis facilities to store this?
> if osm2pgsql knows the projection, it could be made to save it there, or at
> least to spill it out...
Actually, there is, but nobody uses it :)
All spatial columns are usually described in the `geometry_columns'
table, which contains the `srid', pointing to spatial_ref_sys.srid .
That row, in turn, contains the `proj4text' column, which contains
exactly what we want: the Proj4 string.
Unfortunately, the "Spherical Mercator" projection we use these days
aren't already prepared in the `spatial_ref_sys' table. However, at
least the SVN version of `osm2pgsql' contains the needed SQL statement
(in file `900913.sql'), which, however, cannot be executed by a
regular user if the GIS-enabled database was created as recommended by
Debian's README (shipped with the postgresql-8.3-postgis package) due
to missing INSERT privileges.
So I guess we'd simply work on (submit, ask again, ...) the PostGIS
people to simply include this SRS, too. That way, a simple SELECT
would give us the correct Proj4 string.
(However, if somebody *really* changes it, some assumptions will
break. Eg. I still wonder about the 0.00028 factor all the time...)
MfG, JBG
--
Jan-Benedict Glaw jbglaw at lug-owl.de +49-172-7608481
Signature of: Friends are relatives you make for yourself.
the second :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.gpsdrivers.org/pipermail/gpsdrive/attachments/20080926/1283e859/attachment.bin>
More information about the GPSdrive
mailing list