2

I'm having some issues converting my project into an MBTiles format. I'm trying to use gdalwarp to convert my main file to geotiff format, but I can't seem to get the center coordinate to how it is with my google maps custom map.

My center coordinate is latitude:-53.722541 and longitude:-100.625000 using Google Maps. I'm not sure how to use gdalwarp to ensure my center coordinate to remain at the same position. My files dimensions are 8192x8192.

The command I've been running is:

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3785 -r bilinear -te -4096 -4096 4096 4096 input.png output.tif

The SRS projection I'm using with TileMill is:

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over

I'm at a loss at which of those two I would need to change in order to keep my markers properly placed, and not need to redo each and every one of them.

Thanks in advance for any support with this,

2

you'd need to use first EPSG:3857 instead of EPSG:3785. I'd say that you need to define also the center coordinate in your gdal commands. I'd say you need for that two commands, gdaltransform and gdalwarp, as you were using it. BTW, your TileMill projection seems to be utm mercator (ie. for google stuff), and you're dealing with geographical degrees (ie. epsg:4326 or epsg:3857) with gdalwarp.

Check these posts to see if you can find some more help:

  1. Transforming EPSG:3857 to EPSG:4326
  2. EPSG 3857 or 4326 for GoogleMaps, OpenStreetMap and Leaflet
  3. How to transform World data from EPSG 4326 to EPSG 3857

Hope this helps,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.