Bonjour,
Dans notre application mobile, nous utilisons des images géoréférencées provenant d'autres applications. Ces images ont été générés avec la projection Lambert93.
Nous utilisons les instructions suivantes:
<<<
Esri.ArcGISRuntime.Rasters.Raster rasterFile = new Esri.ArcGISRuntime.Rasters.Raster(rasterFileName);
rasterLayer = new RasterLayer(rasterFile) { Name = "IMG_" + rasterFileName };
await rasterLayer.LoadAsync();
CurrentMap.OperationalLayers.Add( rasterLayer);
>>>
Nous obtenons un message d'erreur indiquant que le SpatialReference n'est pas défini.
Que faire pour forcer le SpatialReference à "Lambert93" ?
Hi,
Does "CurrentMap" already contain a Basemap or other layers in the OperationalLayers collection when you add the raster data?
Thanks
Mike
Hi,
Yes, the Basemap already has a map in it and OperationalLayers is filled.
Thanks,
Augustin
Because the Map already has a Basemap that will have determined the spatial reference of the MapView. Most layers in the OperationalLayers collection will be reprojected on-the-fly if they don't match the spatial reference of the MapView.
The .tfw file you attached should define the projection of the raster dataset and allow it to be displayed.
Do you see and LoadError (on the layer) or LayerViewState error (on the MapView)?
Thanks
Mike
Hello Mike,
Here is what i get in LayerViewState Error :
Esri.ArcGISRuntime.ArcGISRuntimeException: Internal error: The raster layer does not have a spatial reference.
I have an other raster file which displays correctly.
What is missing in the .tif and .tfw files ? And how can I dynamically add these informations ?
Thanks
Augustin
Hi Mike,
Any other idea about my request ?
Thanks
Hi,
Unfortunately your raster dataset is missing spatial reference information. You can use the ArcGIS Pro `Define Projection` tool to add the spatial reference information.
Are you building a WPF application?
Thanks
Mike
Hi,
No I'm building an Xamarin forms application with the ArcGis Runtime SDK for .Net.
Where can I find the 'Define Projection' tool and how to make it available and easy for use to my users ?