I am trying to add a shapefile to a one of my maps. I got the Shapefile form the State of Oregon. Its an Shapefile containing the political districts, one for the state house and one for the state senate. Looking in the XML file that came with the shapefile, it appears to be NAD83 Lamebert Conformal Conical projection. I tried making a striped down project that jsut loads the shapefile. I was not able to display it in feet, meters or decimaldegree as mapunits. I made a projection object and tried to project it. I am familar with using your projection object. I have been using it successfully.
I guess what I need to know is the code for this projection. I did some research and it look slike I should be using 2991 or 2992. Both of which did not work. I also tried just epsg 83 and 8901 which also didnt work.
Any ideas. I am attaching a screenshot of the XML for the shapefile that contains the projection information.
I did a search in spatial-reference.org to see if there is a standard projection used for Oregon. The closest thing I could find according to the parameters I saw in your XML is EPSG 2992 spatial-reference.org/ref/epsg/2992/proj4/ as you did. But i notice that the false easting parameters is different:
//Define a Layer Overlay object LayerOverlay ShapeFiles1 = new LayerOverlay(); ShapeFiles1.IsBaseOverlay = false; //Add the Shape Layer to the Layer Overlay Object //ShapeFiles1.Layers.Add(layer1); ShapeFiles1.Layers.Add(layer2);
thanks for your help. I did not realize that you could put the projection information directly into the object as a string.
I tried your code snippet but its not working. I am attaching the shapefile that I got from the Oregon state website. Could you please look at it. I think there must be something I am missing or the shapefile is bad.
thanks
I can not attach the zip file because it is over 500kb. I am posting the link to the website where I got the file
I reviewed all of the comments above and I checked the shape files what you attached, I found out a problem in your code, actually, your shape file is the multi polygon shapes, but you render it used the line style, obviously, the shape file cannot be displayed correctly whatever the mapunit, please use the following code to try again with your shape file:
//Setting up the Map Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
//Define a Layer Overlay object LayerOverlay ShapeFiles1 = new LayerOverlay(); ShapeFiles1.IsBaseOverlay = false; ShapeFiles1.Layers.Add(layer2);
Map1.CustomOverlays.Add(ShapeFiles1); You can see I didn't use any code for projection, I just set the mapunit to Feet and change the line style to area style then the shape file can be displayed correctly, according to your first comment, I think this is your real problem,
If you still have any other questions please let us know,
I am glad Scott helped you solve the style problem.
I would like to bring the projection issue you are having and bring one correction. For the internal projection parameters, you have to pass a string due to the custom parameters used for the Oregon projection. The false Easting is always expressed in meters in the Proj4 string, as opposed to the prj file were it can be expressed in feet. So the false easting is going to be 400 000 (not 1 312 336).