[OSM-dev] Projection problems

2008-12-16 Thread Bradley Kite
Hi all,

I wonder if any one could be so kind as to help me out with a problem
I am having with projections:

I am trying to convert from lat/long coords to the Mercator projection
as is used in osm2pgsql

I am using this code:

http://wiki.openstreetmap.org/index.php/Mercator#Java_Implementation

The Lat/Long I am using is (bounding box around a street I know):

-0.90362548828125,51.38892310050485 to -0.90087890625,51.38720911696496

However, when converted to Mercator projection as per the above Java
code, I get the following:

-100591.12922329194,6656970.686752424 to -100285.38111015123,6656665.738991335

The y values (6656970 - 6656665) do not match up with data the
postgres database:

LINESTRING(-100491.52 6690303.05,-100474.32 6690280.11,-100456.16
6690259.1,-100438.02 6690235.21,-100434.02 6690222.73,-100430.37
6690211.33,-100433.23 6690176.94,-100434.19 6690146.36,-100432.48
6690134,-100430.37 6690118.64,-100417.95 6690093.81,-100398.83
6690072.78,-100373.27 6690047.38,-100370.16 6690038.6,-100327.34
6689918.14,-100309.98 6689869.27,-100245.01 6689884.55)

Note - all the Y values in the DB are ~669 not ~665 as
returned by the mercY() function.

The effect of this is that an SQL query to pull data from the database
is not fetching the correct data.

Would there happen to be an expert on this list that help out with the
accuracy of the projection code at the above link? It only affects the
Y coordinate, X seems fine.

Many thanks in advance.

--
Brad.

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Projection problems

2008-12-16 Thread Bradley Kite
Many thanks for your answers.

I will have a look through the osm2pgsql code to try figure out the scaling
factor.

--
Brad

On 16 Dec 2008, 5:27 PM, Thomas Wood grand.edgemas...@gmail.com wrote:

osm2pgsql uses a spherical mercator projection which cuts down on the
amount of math required to produce a reasonable estimation of the
earth for our uses.
It's not a 'proper' projection in the GIS sense, but it works for our
purposes.

http://wiki.openstreetmap.org/index.php/Mercator#Spherical_Mercator

I'm not sure what scaling factor osm2pgsql uses

Somewhat related implementations are at
http://wiki.openstreetmap.org/wiki/Tilenames#Java

2008/12/16 Bradley Kite bradley.k...@gmail.com:

 Hi all,   I wonder if any one could be so kind as to help me out with a
problem  I am having wi...
 ___
 dev mailing list
 dev@openstreetmap.org
 http://lists.openstreetmap.org/listinfo/dev




--
Regards,
Thomas Wood
(Edgemaster)
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


[OSM-dev] Correct place to submit patches?

2008-11-26 Thread Bradley Kite
Hi all,

I'm new to this mailing list and to OSM in general so would like to
introduce myself first.

I am Bradley Kite, and have an interest in getting Mapnik/OSM running
on the Android mobile platform: http://code.google.com/p/osmdroid/

Currently, the software downloads map tiles on demand (and caches them
locally), but I have been working on having a map-tile renderer work
on the phone itself, from a database on the phone's SD card (so that
map-tiles can be provided in the absence of phone signal).

To this aim, I have mostly ported mapnik to Java (its not complete
yet, but not far from it)
(http://code.google.com/p/osmdroid/source/browse/#svn/branches/osm-contributor)
and have patched osm2pgsql so that it can output to an sqlite database
instead of postgres (sqlite libraries etc. come with the phone's
software stack).

I'd like to submit this patch back so that it could be included in
future versions of osm2pgqsl - so that others can build sqlite
databases of their local countries that can work on the phone.

Please advise on the correct procedure.

Regards
--
Brad.

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev