Creating world file for maptiler - google-maps

I have an image which 21810x14872 that project a box of an area with coordinate:
top, left corner latitude longitude : 23.635069763547662 , 58.09107365049769
bottom, right corner latitude longitude : 23.598520470202025 , 58.14957297881731
OR using WGS84 northing, easting:
top, left corner easting, northing : 617289.588, 2610249.342
bottom, right corner easting, northing : 611289.588, 2614249.428
My image use projection of WGS84. How do I create world file for maptiler using above description.
Thanking You.

In MapTiler (http://www.maptiler.com/) you can use the "Bounding Box" georeferencing - to provide the four limiting coordinates (north, south, east, west) you mentioned above to assign location to your image directly. You probably don't need to create a World file then.
Just choose in MapTiler the "Mercator tiles", then drag&drop in your file, select your coordinate system (default is the WGS84 geodetic latitude / longitude) and on assign location click on Bounding box. A dialog opens when you can directly type the four numbers. MapTiler previews the covered area in the small map window in bottom right corner.
See these video tutorials which demonstrate the usage of Bounding Box:
https://www.youtube.com/watch?v=p8rNkaNXDPs&list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay
and another which also generates MBTiles and upload these to Amazon S3:
https://www.youtube.com/watch?v=pf8itiTwo6w&list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay
BTW WGS84 is a world geodetic system (latitude and longitude) in degrees. It is not a map projection nor projected system. The second coordinates you mentioned look like UTM coordinates or another projected coordinates in meters. To use these you would need to know the exact coordinate system definition (ideally so called EPSG code - see our http://epsg.io/).

Related

Selecting Coordinate System in Maptiler

I have an image which 21810x14872 that project a box of an area with coordinate:
top, left corner latitude longitude : 23.635069763547662 , 58.09107365049769 bottom, right corner latitude longitude : 23.598520470202025 , 58.14957297881731
OR using WGS84 northing, easting:
top, left corner easting, northing : 617289.588, 2610249.342 bottom, right corner easting, northing : 611289.588, 2614249.428
My image use projection of WGS84. I'm not sure which Coordinate System in Maptiler I need to select? Please advice.
Thanking You.
The answer is equal to: Creating world file for maptiler
In MapTiler (http://www.maptiler.com/) you can use the "Bounding Box" georeferencing - to provide the four limiting coordinates (north, south, east, west) you mentioned above to assign location to your image directly. You probably don't need to create a World file then.
Just choose in MapTiler the "Mercator tiles", then drag&drop in your file, select your coordinate system (default is the WGS84 geodetic latitude / longitude) and on assign location click on Bounding box. A dialog opens when you can directly type the four numbers. MapTiler previews the covered area in the small map window in bottom right corner.
See these video tutorials which demonstrate the usage of Bounding Box:
https://www.youtube.com/watch?v=p8rNkaNXDPs&list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay
and another which also generates MBTiles and upload these to Amazon S3:
https://www.youtube.com/watch?v=pf8itiTwo6w&list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay
BTW WGS84 is a world geodetic system (latitude and longitude) in degrees. It is not a map projection nor projected system. The second coordinates you mentioned look like UTM coordinates or another projected coordinates in meters. To use these you would need to know the exact coordinate system definition (ideally so called EPSG code - see our http://epsg.io/).

generate layers for maps (Google or OpenLayers)

I'm trying to develop a software that gets data from a text file and generates a map layer. The map later on is going to be cut into tiles and used as overlay for Google Maps API or OpenLayers.
The data stored in the text file is weather data. The file has data about 1 x 1 squares. For example: there is .9 chance of rain for lat 1-2 and lon 5-6. I have to use the data provided in the data file and can't use pre-generated layers.
I generate the map by dividing a background white PNG into 360 horizontal boxes and 180 vertical ones and color each one based on the data available in the text file.
My problem is the fact that there are 180 latitudes and 360 longitudes but the base map for OpenLayers and Google Maps is a square. In other words, number of latitudes equals the number of longitudes in OpenLayers and Google Maps. Moreover when I take a world map and stretch it vertically the lines do not align at all.
Example:
OpenLayer base map (256px x 256px):
Generated layers (256px x 256px):
When I add the layer on top of the base map. Continents don't match. I don't have this problem when i use a non-square(256px x 128px) base map.
My question is how should I generate my layover so it works with a square world map that is being used by Google and OpenLayers?

How to translate mercator map coordinates to relative screen coordinates?

I have a database with various map locations (latitude, longitude).
I've been using a map api (e.g. google maps) to plot these locations.
I am now experimenting to see if I can totally remove dependency of map apis and simply replace the map control with an image (an .png image).
Question:
How can I translate the map locations to be displayed properly onto this map image?
More details:
Basically, the map will be a rectangular area (i.e. Div element), where the top-left corner of the rectangle is obviously (0, 0). So basically the map locations will be displayed with respect to this top-left corner.
First off, where are you getting your geocodes from? If they are from Bing or Google Maps then you can only use those coordinates with those map controls. Using this coordinates without the map controls is against the terms of use of these API's. Assuming that these coordinates come from somewhere else you can overlay them on an image by first knowing some information about the image. At a minimium you will need to know two coordinates on the image and their relative pixel locations. From that you can then determine the scale and top left coordinate of the image. With this you can then fairly accurately position coordinates on the image using a lot of math. You can find a lot of useful math for this here: http://msdn.microsoft.com/en-us/library/bb259689.aspx I've writing a few blog posts on this a while back which you can find here: http://rbrundritt.wordpress.com/2008/10/25/ve-imagery-service-and-custom-icons/
If these coordinates come from Bing Maps you can easily display them on a map image using the Bing Maps Imagery Service: http://msdn.microsoft.com/en-us/library/ff701724.aspx

KML coordinates are off in a custom Google Map?

EDIT: Turns out it was all because the coordinate translation functions in the javascript were written wrong. The author of the program has apparently fixed it.
I'm trying to use KML files to display placemarks on a custom Google Maps map. The map was generated by a Minecraft mapping program called Unmined.
My problem lies with the positioning of placemarks. They are placed on the map in a position that doesn't seem to correlate with either the pixel or latitude/longitude coordinates of the map itself.
Here is an image showing my problem.
I loaded a KML with five placemarks defined. One in the middle (0,0), one in the top-left corner (-170,80), one in the top-right corner (170,80), one in the bottom-left corner (-170,-80), and one in the bottom-right corner (170,-80). The set of markers seems to be duplicated horizontally but from my experience that's standard with Google Maps. As far as I know, the range of valid coordinates in a KML file are from -180 to 180 longitude and -90 to 90 latitude, which means that any valid placemark would have to fall somewhere inside that rectangle. Except that rectangle barely intersects the map at all.
If you need access to the code I'm using, everything can be found in the source of http://tonyfox.ws/dt/kantomap/ (URL may not exist forever)
So am I just doing something catastrophically wrong or what?
On a related note, how does Google Maps decide where to place the map in the coordinate system when the map isn't an actual Earth map (like this Minecraft world map)? My map seems to range from about 14.5 to 19.5 longitude, and 25.5 to 28 latitude. Why such weird numbers?

calculate longitude and latitude from topleft static google map

I use a static map (image) from google in a mobile phone app. What i have is: the longitude-latitude data from the center (of the image), the size of image, the zoomlevel.
How can i calculate the longitude-latitude data of the top-left (or any other place) of the image?
You need to compute the lat/lon from a range/bearing calculation (see destination point from distance and bearing given here: http://www.movable-type.co.uk/scripts/latlong.html). The zoom level will give you the range part. For the bearing part, is the map north up? If it is, then the bearing for the upper left will be 315 degrees (360 - 45). If you don't know if the map is north up, then you will need another lat/lon point.