GIS Dunce seeks guidance for shapefile data viewing problems

Topics: General Topics
Aug 22, 2006 at 9:17 PM
Hello,

i can run the sample website provided just fine but it's only when i try to view my shapefile with the demo is whenever i cannot see anything.

my shapefile data DOES come with a PRJ file :

PROJCS"NAD_1983_UTM_Zone_13N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-105.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]

..and I receive no errors whenever the application loads it. I noticed the SRID value and commented it out but it made no difference (not sure as to where to look for the value for my particular data).

i guess I am looking for guidance on saying "If you have this type of data, use this SRD" or "if you have this type of data then use this coordinate transformation". it's late in the afternoon and my lightbulb is dimming....

by the way I do have all of these files that are in the same data directory with the SHP file:

.dbf
.prj
.sbn
.sbx
.shx

thanks in advance!

Wes
Developer
Aug 23, 2006 at 12:50 AM
SharpMap doesn't transform a layer unless you tell it to. Try removing the other layers and zoom to the extents of your layer.
Aug 23, 2006 at 1:18 PM
Yes I have tried that with only my shape file loading up (removing all of the other layer code in the sample and keeping this one in) and it still shows only a blank map.

Now as for the extents you are talking about, does the prj file hold this information?

spacey....
wes
Aug 23, 2006 at 1:23 PM
The Code:

Dim map As SharpMap.Map = New SharpMap.Map(size)

Dim lyrParcels As SharpMap.Layers.VectorLayer = New SharpMap.Layers.VectorLayer("Parcels")
lyrParcels.DataSource = New SharpMap.Data.Providers.ShapeFile(HttpContext.Current.Server.MapPath("App_Data/parcels.shp"), True)
lyrParcels.Style.Outline = Pens.Azure
lyrParcels.Style.EnableOutline = True
lyrParcels.Style.Fill = New SolidBrush(Color.Beige)
lyrParcels.SRID = 4326

map.Layers.Add(lyrParcels)
map.MaximumZoom = 360
map.BackColor = Color.White
map.Zoom = 360
map.Center = New SharpMap.Geometries.Point(0, 0)

HttpContext.Current.Trace.Write("Map initialized")
Developer
Aug 23, 2006 at 3:42 PM
try:
map.ZoomToExtents(); //Zoom to all layers
or
map.ZoomToBox(myLayer.Envelope); //Zoom to layer
Aug 30, 2006 at 8:04 PM
UPDATE:

Just wanted to let you know that the following code produced a map!

map.ZoomToBox(myLayer.Envelope); //Zoom to layer

Thank you so much for all of your help on this!

Wes