Loading shape

Answered (Verified) This post has 1 verified answer | 2 Replies | 2 Followers Thread's RSS feed.

Replied On: Sat, Jan 15 2011 11:46 AM Reply

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

  • Post Points: 20

Verified Answer

Answered (Verified) Replied On: Mon, Jan 17 2011 7:57 AM Reply
Verified by guillermodelatorre

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

  • Post Points: 40

All Replies

Answered (Verified) Replied On: Mon, Jan 17 2011 7:57 AM Reply
Verified by guillermodelatorre

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

  • Post Points: 40
Replied On: Mon, Jan 17 2011 5:09 PM Reply

Thanks for your prompt response. It has been very helpful.

  • Post Points: 5
Page 1 of 1 (3 items) | RSS