Hello, I am trying to use Maperitive to generate tiles, then use those osm tiles as the map background layer in my application. The map features on other layers are created by MapInfo. It looks like the osm tiles and features in other layers don't align in y-coordinates. I figured this is to do with MapInfo is using NAD83 projection, but osm tiles are in Mercator projection. I wonder what is the best way of generating osm tiles in NAD83 projection. Do I have to generate tiles in Mercator using Maperitive, and then re-project tiles to NAD83 projection using MapProxy? Thanks. asked 30 Sep '13, 12:23 hua zhang SomeoneElse ♦ |
The question has been closed for the following reason "Questioner requested question closed (see comment below)." by SomeoneElse 15 Oct '13, 10:07
The OSM PostGIS 0.6 schema ("pg_snapshot") is built on the WGS-84 projection, as can be seen by one of the (many) lines of its creation script:
To convert them to a new projection (in this case "NAD83", SRID 4269 as listed here), you cannot simply set the SRID of the column:
Because the ST_SetSRID() function does not perform a projection transformation, as described on the documentation. Therefore, you have to use the ST_Transform() function, saving the result on another column that has the SRID of the NAD-83 projection. For example:
And then using the new column as the source of the data, or issuing a few more commands to replace the old column with the new one. Please note that things may get somewhat complicated should the columns be part of indexes, for example. Make sure that you have the NAD-83 projection installed on your PostGIS
You may also try to perform the transformation "on the fly" changing the source code of your interface, or maybe creating views from the tables, but probably it would be very CPU expensive (and probably very slow as well). Additional material obtained from this StackOverflow question EDIT: Fixed some typos, added link to st_transform reference. answered 01 Oct '13, 12:00 MCPicoli Thank you very much MCPicoli. Is that possible to modify Maperitive to generate tiles in NAD83 projection? If yes, could you give me some guideline on how to modify the source code? Thanks.
(08 Oct '13, 04:29)
hua zhang
Sorry, very little experience with Maperitive.
(08 Oct '13, 18:40)
MCPicoli
Thanks you very much for your help MCPicoli. It turned out to be a mistake in my end. I am drawing the tiles on the display region using the wrong y-coorinates. There is no need for projection conversion. The map looks beautiful. Thanks.
(15 Oct '13, 01:25)
hua zhang
Can anyone help me to close this question please? Thanks.
(15 Oct '13, 01:26)
hua zhang
|
For info, this grew out of a previous discussion here.