Geographic Information Systems Asked on April 30, 2021
I am using MapWinGIS with c#. I am trying to create a buffer for a polygon that has WGS84 decimal degree reference system, but it never get displayed.
Here is my code:
// Form load
var gp = new GeoProjection();
gp.SetWgs84Projection(tkWgs84Projection.Wgs84_UTM_zone_40N);
axMap1.GeoProjection = gp; //set map projection to projected mercator
...
if (sfAOI.Open(fileName, null) ) //open shapefile wgs84 lat long RS
{
axMap1.RemoveLayer(aoiHandler);
aoiHandler = axMap1.AddLayer(sfAOI, true); //Lat Long
//till here, all data loaded are in lat long coordinate system
//create aoi buffer
sfAOIBuffer = new Shapefile();
sfAOIBuffer = sfAOI.BufferByDistance(500, 20, true, false);
aoiBufferHandler = axMap1.AddLayer(sfAOIBuffer, true);
axMap1.MoveLayerTop(aoiBufferHandler); //does not appear.
}
Which suppose to create a buffer after successfully loading area of interest.
Having all data are in WGS84, I need to be able to create buffer on the fly in meters regardless to data reference system.
I am not sure if projection will really solve the problem because that deals only with data display.
What am I missing?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP