<div>Hanko,</div>
<div> I find that often FDO has a problem reading prj files. One method I have used is that when I am creating a file in map and I have already assigned a projection I then "re-project" when exporting. that is I just re-assign the projection in the last tab of the export dialog even though it is the same projection. This forces map to creat the prj. which I then find is in the correct format.</div>
<div>If the file is being used in a persistent manner in a adwg you can select the (unknown) file and edit the coordinate system which then will persist each time you open the drawing that it is attached to.</div>
<div>Brad<br><br></div>
<div class="gmail_quote">On Fri, Jun 11, 2010 at 2:59 AM, hanko <span dir="ltr"><<a href="mailto:hana.jaborova@spatialtechnology.se">hana.jaborova@spatialtechnology.se</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>According to wikipedia:<br><br>Shapefile projection format (.prj)<br><br>The projection information contained in the .prj file is critical in order<br>
to understand the data contained in the .shp file correctly.<br>Although it is technically optional, it is most often provided, as it is not<br>necessarily possible to guess the projection of any given points.<br>The file is stored in well-known text (WKT) format.<br>
<br>Some typical information contained in the .prj file is:<br> * Geographic coordinate system<br> -------------<br>I create a new spatial context<br>Then I create a new chema with a few Feature Classes.<br>I set geom.SpatialContextAssociation = newSpatialContext.Name;<br>
<br>When I apply schema for every Feature Class are created a bunch of files<br>with the same name as Feature Class (shp, shx, idx, dbf, cpg).<br>I wonder why is not a PRJ file created for each Feature Class automatically.<br>
<br>private void CreateSpatialContext()<br>{<br> string wkt = "GEOGCS [ \"Longitude / Latitude (WGS 84)\", DATUM [\"WGS<br>84\", SPHEROID [\"WGS 84\", 6378137, 298.257223563]], PRIMEM [<br>
\"Greenwich\", 0.000000 ], UNIT \"Decimal Degree\", 0.01745329251994330]]";<br><br> using (ICreateSpatialContext create =<br>_conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_CreateSpatialContext)<br>
as ICreateSpatialContext)<br> {<br> using (FgfGeometryFactory geomFactory = new FgfGeometryFactory())<br> {<br> DirectPositionImpl lowerLeft = new DirectPositionImpl();<br>
lowerLeft.X = -180.0;<br> lowerLeft.Y = -90.0;<br> DirectPositionImpl upperRight = new DirectPositionImpl();<br> upperRight.X = 180.0;<br>
upperRight.Y = 90.0;<br> create.CoordinateSystemWkt = wkt;<br> //MyStream.Write(create.CoordinateSystemWkt);<br> //MyStream.Close();<br>
create.Description = "This Coordinate System is used for GPS.";<br> create.ExtentType =<br>SpatialContextExtentType.SpatialContextExtentType_Static;<br><br> IEnvelope envelope = geomFactory.CreateEnvelope(lowerLeft, upperRight);<br>
IGeometry geom = geomFactory.CreateGeometry(envelope);<br> create.Extent = geomFactory.GetFgf(geom);<br> create.Name = _spatialContext;<br> create.UpdateExisting = false;<br>
create.XYTolerance = 0.001;<br> create.ZTolerance = 0.001;<br> create.Execute();<br> if (geom != null)<br> geom.Dispose();<br>
}<br> }<br>}<br><br><a href="http://osgeo-org.1803224.n2.nabble.com/file/n5166854/ship.bmp" target="_blank">http://osgeo-org.1803224.n2.nabble.com/file/n5166854/ship.bmp</a><br><br>I create a file containing the WKT text.<br>
TextWriter MyStream = null;<br>string prjFile = @"C:\Temp\SHP\Ship.prj";<br>MyStream = File.CreateText(prjFile);<br>MyStream.Write(wkt);<br>MyStream.Close();<br><br><a href="http://osgeo-org.1803224.n2.nabble.com/file/n5166854/ship_coord.bmp" target="_blank">http://osgeo-org.1803224.n2.nabble.com/file/n5166854/ship_coord.bmp</a><br>
<br>Cheers Hanko<br><font color="#888888">--<br>View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Shapefile-and-spatial-context-tp5166854p5166854.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Shapefile-and-spatial-context-tp5166854p5166854.html</a><br>
Sent from the FDO Users mailing list archive at Nabble.com.<br>_______________________________________________<br>fdo-users mailing list<br><a href="mailto:fdo-users@lists.osgeo.org">fdo-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/fdo-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/fdo-users</a><br>
<br></font></blockquote></div><br>