Projecting undesigned radar images in osmdroid

I wrote an application for radar weather using osmdroid for map tiles and manually overlaying the NOAA radar data. Everything works fine, except that the radar images are not designed and the openstreetmap slabs are in the transverse projection of the Mercator. The weather lies within the limits that should be, but the data is distorted.

I see three ways to fix this (in order of preference), but I have problems with all three:

1) find the source of the radar data already projected into the Mercator - Googling watches later, I did not find anything 2) programmatically reprogram the images immediately after they are downloaded. Does anyone know a good API for this? 3) design them on the fly, possibly with openlayers.im reads that can be played in openlayers, but can they be used on top of the osmdroid mapview top?

Any ideas? Thanks for any help Mike

+4
source share
1 answer

GDAL is the way to go. There is no official Android build that I know of, but some people have been successful in launching it on Android. For example, Nutiteq has an assembly in the libs folder of its AdvancedMap3D sample project. Put the contents of both armeabi folders in the lib project folder and you can access the GDAL packages.

Then check out GDAL in Java . Check out the gdalinfo.java sample to understand how to download and learn parts of the GDAL dataset. To repurpose your data set, you will do something according to:

SpatialReference sr = new SpatialReference(); sr.ImportFromProj4("+proj=merc +datum=WGS84"); String result[] = new String[1]; sr.ExportToPrettyWkt(result, 1); String oldProjection = mDataset.getProjection(); String newProjection = result[0]; Dataset newDataset = gdal.AutoCreateWarpedVRT(mDataset, oldProjection, newProjection, gdalconst.GRA_NearestNeighbour, 0.0); Dataset savedDataset = mDriver.CreateCopy(outpath, newDataset, 0, new String[] { "COMPRESS=LZW", "PREDICTOR=2" }, null, null); newDataset.delete(); savedDataset.delete(); 

You may need to make a few adjustments, but this should make you most of the way.

0
source

Source: https://habr.com/ru/post/1495053/


All Articles