What I would like to be able to do is browse to an arbitrary geotiff file and use it as a reference layer. I would then like to add arbitrary shapefiles. I realize that the vector layers (shapefiles) must be projected to match the geotiff but I don't know anything about the geotiff until runtime. I have seen the example of how to read shapefiles' .prj file to get its projection information. However, I don't know the projection of the geotiff or what to set the map units to. All the examples I have seen so far have hard coded the map units and projection information but I need to do all the work at runtime. Any ideas?
GeotTiff Projection information
Hi Wes,
Thanks for let us know your requirement.
I am sorry we don’t support read unit and projection then set it to map at runtime now.
But I think if you actually know what you can read from your geotiff file, you will implement that yourself.
1. You must know what information you can read from geotiff file about mapUnit and projection, I think we don’t have an existing function to read them from file now, so you need find a way to do this.
2. You can build your custom function for parse the information to our MapUnit and projection string, maybe you can get help from some 3rd part class library for it.
3. You can set the mapUnit after you parse everything from tiffData and set projection at runtime for ShapeFile, here is a quickly sample about how to set it.
Proj4Projection proj4Projection = new Proj4Projection();
// Here you can set internal projection string and external projection string at runtime after you read them from file
proj4Projection.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4Projection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(2163);
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/world/cntry02.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.FeatureSource.Projection = proj4Projection;
Any more questions please let us know.
Regards,
Don
Has it been decided when raster projection support would be added? Would a function for reading a raster’s projection information be included as part of that update?
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/42/aft/9041/afv/topic/Default.aspx
Assuming, based on my previous questions, that waiting for an update is not an option then I do have a couple of questions about retrieving the projection information for a raster.
1) Is there an easy way to determine the units to use based on the projection?
2) Does the GDAL function GDALDataset::GetProjectionRef() return the projection in the correct format?
3) Assuming the answer to the previous question is yes, is there an easy way to leverage the same GDAL being used by the MapSuite deployment?
Hi Wes,
In fact we are working for integrate the raster reprojection function, we will release it after it work steadily and send update to customers.
1) I think we can read the mapUnit from projection string
2) I did a quickly research about GDAL, it also integreate proj4, so I think if this function return the proj4 projection string, it can be used directly in our code
3) Sorry I think we don’t have a easy way for it, till now our MapSuite control haven’t integrate GDAL, that’s a pending task we will work for.
Regards,
Don
Hi,
Is GeoJpeg format supported by ThinkGeo Map Suite?
Regards,
Jacob
Hi Jacob,
Yes, map suite has supported this file format, here is a file format list which map suite supports, please check it.
wiki.thinkgeo.com/wiki/Map_S…rmat_Guide
Any questions, please let us know.
Thanks,
Troy