[fdo-users] Shapefile and spatial context
kidsmake6 at msn.com
Fri Jun 11 09:40:03 EDT 2010
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
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.
On Fri, Jun 11, 2010 at 2:59 AM, hanko
<hana.jaborova at spatialtechnology.se>wrote:
> According to wikipedia:
> Shapefile projection format (.prj)
> The projection information contained in the .prj file is critical in order
> to understand the data contained in the .shp file correctly.
> Although it is technically optional, it is most often provided, as it is
> necessarily possible to guess the projection of any given points.
> The file is stored in well-known text (WKT) format.
> Some typical information contained in the .prj file is:
> * Geographic coordinate system
> I create a new spatial context
> Then I create a new chema with a few Feature Classes.
> I set geom.SpatialContextAssociation = newSpatialContext.Name;
> When I apply schema for every Feature Class are created a bunch of files
> with the same name as Feature Class (shp, shx, idx, dbf, cpg).
> I wonder why is not a PRJ file created for each Feature Class
> private void CreateSpatialContext()
> string wkt = "GEOGCS [ \"Longitude / Latitude (WGS 84)\", DATUM
> 84\", SPHEROID [\"WGS 84\", 6378137, 298.257223563]], PRIMEM [
> \"Greenwich\", 0.000000 ], UNIT \"Decimal Degree\", 0.01745329251994330]]";
> using (ICreateSpatialContext create =
> as ICreateSpatialContext)
> using (FgfGeometryFactory geomFactory = new
> DirectPositionImpl lowerLeft = new
> lowerLeft.X = -180.0;
> lowerLeft.Y = -90.0;
> DirectPositionImpl upperRight = new
> upperRight.X = 180.0;
> upperRight.Y = 90.0;
> create.CoordinateSystemWkt = wkt;
> create.Description = "This Coordinate System is used
> for GPS.";
> create.ExtentType =
> IEnvelope envelope =
> geomFactory.CreateEnvelope(lowerLeft, upperRight);
> IGeometry geom =
> create.Extent = geomFactory.GetFgf(geom);
> create.Name = _spatialContext;
> create.UpdateExisting = false;
> create.XYTolerance = 0.001;
> create.ZTolerance = 0.001;
> if (geom != null)
> I create a file containing the WKT text.
> TextWriter MyStream = null;
> string prjFile = @"C:\Temp\SHP\Ship.prj";
> MyStream = File.CreateText(prjFile);
> Cheers Hanko
> View this message in context:
> Sent from the FDO Users mailing list archive at Nabble.com.
> fdo-users mailing list
> fdo-users at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fdo-users