First excuse my bad English.I just purchased the Ultimate Suite 2010 vol3, but I have problems loading a shape in xammap. From what I read in forums is a matter of projection coordinates, but can not find how to solve it. I hope you can help me with the code in both VB and in xaml.I am attaching the files shp, shx, dbf and prj generated by ArcView
Hi guillermodelatorre,
Your shapefiles use the Transverse Mercator projection and WGS 1984 datum. Try the following XAML code:
<Maps:XamMap x:Name="xamMap"> <Maps:MapNavigationPane igControls:XamDock.Edge="InsideRight" /> <Maps:XamMap.Layers> <Maps:MapLayer> <Maps:MapLayer.Reader> <Maps:ShapeFileReader Uri="ShapeFiles/Tamasopo/TAMASOPO"> <Maps:ShapeFileReader.CoordinateSystem> <Maps:CoordinateSystem UnitType="M" FalseEasting="500000.0" FalseNorthing="0.0" > <Maps:CoordinateSystem.Projection> <Maps:TransverseMercator EllipsoidType="WGS84" ScaleFactor="0.9996" CentralMeridian="-99.0" LatitudeOrigin="0.0" /> </Maps:CoordinateSystem.Projection> </Maps:CoordinateSystem>
</Maps:ShapeFileReader.CoordinateSystem> </Maps:ShapeFileReader> </Maps:MapLayer.Reader> </Maps:MapLayer> </Maps:XamMap.Layers></Maps:XamMap>
The result:
Information about coordinate system and map projection is stored in the *.prj file. You can read more about the different files that make the shapefile here: http://en.wikipedia.org/wiki/Shapefile. You can even open *.prj file with notepad. Here is the output of TAMASOPO:
PROJCS["WGS_1984_UTM_Zone_14N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-99.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
You can read more about coordinate system and projection from this articles:http://help.infragistics.com/NetAdvantage/WPFDV/2010.3/CLR4.0/?page=xamWebMap_Change_Map_Coordinate_System.html, http://help.infragistics.com/Help/NetAdvantage/WPFDV/2010.3/CLR4.0/html/xamWebMap_About_Map_Projections.html
Regards,
Ivan Kotev
Thanks for your prompt response. It has been very helpful.