I'm looking for help rendering XYZ tiles for openlayers that show layer content up to the poles, not cutting off at ~85 degrees N/S like a lot of mercator handlers do.
So far I've tried both QGIS + QTiles and running the gdal scripts directly.
With either approach, I'm either getting no content at the poles, or the tiled images don't have the layer content centered or stretched correctly, causing it to look glitched on openlayers.
For source data, I've pulled and stiched the high res NASA blue marble files into an 86400x43200 tiff.
Related
In our application we have a backend that does some raster processing on a region of a map and sends back an image to the OL-based frontend which inserts the image at the specified extent.
The polygon to process is sent as GeoJSON-coords (EPSG:4326) to the backend which then transforms the polygon to a rectangular projection (EPSG:3035 in this case), does the processing and sends the heatmapped results back to the frontend as a PNG-encoded image, reprojected server-side to EPSG:3857 (to match the projection of our OSM-based background map). The image is then inserted in an ImageLayer using an ImageStatic object, whose extent is computed by the backend (the EPSG:3035-transformed bounding box of the image transformed to EPSG:3857).
This works fine, except for polygons in the far north of Scandinavia. For instance, the image whose extent in EPSG:3857 is [1684632.9133543067,9544855.787615912,2902401.684702249,10831736.048522325] is visualized the following way when added to the map:
The desirable result is for the image to follow the south-eastern boundaries of the shadowed polygon. Instead it is skewed and stretched out to the north-east.
I would be very grateful for any ideas and pointers as to why this is not working as expected.
I solved this by cropping the image to be reprojected as much as possible. The resulting envelope is then much smaller which did away with the distortions. Thanks for hint #Ian!
New to GoogleMaps and am wondering, before I really dig in, if there is even a way to do what I need... (don't want to waste time discovering I am hunting a unicorn)
I would like to submit some georeference data to GM (ie, center lat/long, width & height in feet or degrees, angle of rotation, satellite or streets) and get back a bitmap/jpg/png of the map described (maybe even a worldfile?)
Possible? If so, what facet of the API should I be investigating?
It is the Google Maps Image APIs https://developers.google.com/maps/documentation/imageapis/?hl=nl
Given an address, is there a way to fetch a static Google map with certain parameters in order to show the entire block including the surrounding streets?
This is the result I'm trying to achieve (I just centered and zoomed manually from Google Maps to make the screenshot):
But when requesting via Static Maps API, using zoom 17 is too far:
and using zoom=18 is too close:
Not to mention that I can't figure out how to do the right centering of the map.
I don't think there's an out-of-the-box way of doing this. There are plenty of possibilities for which block you want to show.
Some complications (there are more, I bet) include:
if you're in a street corner, which of the 4 blocks should the sprite be panned to?
if the address is a park?
if your block has an irregular shape? (even with the rectangular-like blocks in NYC it is complex enough due to their rotation on North axis)
If you have the origin latitude and longitude instead of the address, you could try using the &visible=latLng2 argument for the Static Maps URL, where latLng2 is a modified version of origin including a delta (probably ~0.002 degrees) to make it look similar to your idea. This argument cannot be used with a given zoom.
Before:
After:
Maybe your best option is to go with some calculations in the middle (like Google Geo services to know which is the street around the corner, etc)
Has anyone seen a way to shade/color areas of a google map that are outside of a boundary/shape created by a KML file?
An example usage would be that only the area inside the boundary/shape would be interactive (click listeners etc.), and the shaded area outside of the boundary would ignore all actions aside from the basic map functionality, like moving the map back and forth.
Here is an option I have been working on (doesn't quite completely work, but the concept may address your question):
Create a KML file of the area of interest (in the example US states)
Invert it by adding an outer boundary of the whole world
Either display it on your map using an additional KmlLayer or import it into FusionTable (like the example)
Be sure to suppress infoWindows on the "inverted" layer
Example
- Doesn't work for Virginia or Alaska
- Hawaii is problematic.
- Limits the minimum zoom to 5.
I'm looking to add a custom tile overlay of my university campus on top of a Google Map. What I have is a jpeg image of my university campus layout, and what I'm trying to figure out is how to align it to the existing Google Maps such that I know the top leftmost tile coordinate which I need in order to then run the image through the Photoshop tile cutter script found at http://brokenbytes.info/tuts/documentation/examples/tilecutter.php.
The tool at http://anymap.org/GmapImage2TileGenerator/ sounded perfect for this job, but it looks as though it's only just been moved over to a new server and is proving buggy for me (I enter the image URL of my campus, but then it never shows an overlay of it on top of the map).
Are there any other tools available which can help with visually aligning an image/prepping it for the tile cutter, when the image itself has no geo information immediately attached to it?
The easiest is probably to use the latest MapTiler (from http://www.maptiler.com/) and it's visual georeferencing functionality.
See the video tutorial we prepared: https://www.youtube.com/watch?v=eJxdCe9CNYg