Openlayers GIS - Georeferenced DEM(GeoTIFF) not positioned correctly in Map (OpenStreetMap) - gis

With Openlayers, I'm visualizing GIS rasters(DEM, Orthomosaic) in GeoTIFF format(using WebGLTileLayer) on top of OSM(as WebGLTile layer) in OL Map.
The issue I'm having is, the GIS rasters which have georeferencing, are not positioned in its correct geographic position on the OSM base map. The DEM seems to appear in nowhere, around gulf areas or on top of water bodies.
I've created OSM layer with it's default projection & I'm setting view after raster source is loaded, using source.getView()
I referred to Raster reprojection examples in the Openlayers website, but wasnt able to solve this.
Does anyone have an idea on how to resolve this?

As Mike had suggested in the comments, this issue was happening since even though the projection name was identified from the raster - Eg: "EPSG:3237", the Openlayers library doesnt have the projection definition(what it actually means), so now I'm fetching proj definition from epsg.io & registering in proj4 defs. Now it works perfectly!
Thanks Mike.

Related

How to create a geojson file from an image overlay?

I am looking for a way to create a geojson file from the distributions of the health sectors in my region which are different than any political division readily available on osm:
There are fantastic tools such as geojson.io to draw custom polygons but because of the complexity I would need a tool that allows me to overlay an image to use it as a template or that does this automatically. If this makes a difference, I may be able to extract the silhouette with any computer vision library but my problem of how to get from an image or shape to geojson still remains.
Which is the fastest way to approach this?
You can do this using QGIS with manual georeferencing in order to assign real-world coordinates to an image without geo-information. This is done by clicking points on a map that correspond to points on your image. Then once georeferenced you can export the file as a geojson.
Another solution is to find a shape file (maybe this is correct) and simply convert the .shp into a geojson.

Does openmaptiles support distributing 3D terrain map tiles?

Can OpenMapTiles software dispense 3D terrain data?
I would like to render 3D terrain data in Cesium where the user can see the 3D terrain heights of the terrain when viewed from the side in an offline map server environment.
An example of what I am trying to achieve is this Cesium sandcastle example https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Terrain.html
I am familiar with OpenMapTiles' hillshade and contour map tiles. My understanding is that hillshade tiles are raster only.
I would like to use USGS National Elevation Dataset (NED) tiles, but I don't know how to convert that data to a vector format that OpenMapTiles could send and Cesium could understand.
Looking at the Cesium documentation for imagery providers it looks like Cesium is looking for data in a "quantized-mesh" format for one image provider type. I am not exactly sure what the GoogleEarthEnterprise or VRTheWorldTerrainProvider formats are using.
Any pointers or suggestions is appreciated.
Thanks

Mapbox or Google Maps. Is this possible?

I have a custom map from a client. They want to either use Mapbox or google maps to add markers to it. The problem is they've customized how the world map actually looks. It doesn't show on the map image attached, but they cut off Alaska, and want to show it directly under Texas as a floating state. They also want to show so other states in an odd order. To the right of Alaska they want Hawaii, Puerto Rico, US Virgin Islands.
Two issues here:
1) Can this be done? I can't find any information about cutting pieces of a map up by moving states around.
2) If I CAN do this, will the geocoding still work for the map? Cause now Alaska is way the heck down there.
As far as I know, yes to both of your issues.
Now, to answer your issues:
1) Can this be done? I can't find any information about cutting pieces of a map up by moving states around.
As discussed in Translate your project from Google to Mapbox, you have options to customize maps and features. Then, any customized project created in the Mapbox Editor or uploaded from Mapbox Studio Classic will have a Map ID. Use the Map ID when initializing the map to add it as the active layer.
2) If I CAN do this, will the geocoding still work for the map? Cause now Alaska is way the heck down there.
Yes, geocoding will still work. With Mapbox, L.mapbox.geocoder() will gladly geocode your addresses.
Please try going through the given documentation for more information and for sample codes. Hope that helps!

geoserver preview error when output format is openlayers and png

After I imported shapefiles into geoserver following a tutorial and tried to preview, I find the output image is not right while there is no errors in logs when i choose openlayers or png, jpeg, gif. The image is like a map stained by ink.
However, when I output the layer as PDF, the image is normal ....
All the configurations are default except SRS.
The url is
http://localhost:7070/geoserver/mygis/wms?service=WMS&version=1.1.0&request=GetMap&layers=mygis:roads&styles=&bbox=1.2878111774224255E7,4781149.089993679,1.3037623853023177E7,4928041.91732644&width=768&height=707&srs=EPSG:4326&format=application/openlayers
And the tiled layer of my imported shapefiles is blank.
Is there any way to solve this ?
Thanks in advance !!
With out seeing the map and some more information about the shapefile it is hard to give a definitive answer but looking at the URL you provide the problem seems to be that you have specified the SRS (projection) as EPSG:4326 which is lat/lon degrees while your bounding box appears to be measured in meters which means that all your data will be clustered in the very centre of the map if it really is in degrees or distorted due to the mismatch in projections if it is projected.
As a first guess I would change the SRS parameter to epsg:3875 (web mercator) and see if it looks better.

How to use bbox in long/lat with google/bing/etc… using mapserver‏

The bbox of OpenLayers.Control.GetFeature works in utm when the baselayer is 900913 ie. google/bing/etc) and in long/lat when the baselayer is 4326 (ie. my postgis layers served by mapserver), no matter what overlays them. This is what openlayers says.
So, how can I force bbox to be in long/lat when I use one of my layers over google for example? I do want the bbox being in long/lat rather than 900913 (ie. using baselayer projection). I've read many webs about this but with geoserver, some posts about mapserver say that both EPSG:900913 and EPSG:4326 must be set in METADATA, I changed that and also assigned "srs" and "projection" (with the appropriate expression) in my layers (and in protocols) but with no effect in bbox at all. What else could I try?
Any idea will be appreciated, thanks in advance,
Gery
To solve this problem is necessary to use prototype with OpenLayers.Control.GetFeature and then use .transform with epsg4326 and epsg900913, a bit more info about here: OpenLayers.Class with OpenLayers.Control.GetFeature