How to add your knowledge

Creating SHP Files for the Logical to Physical Schema Mapping

    Table of contents
    No headers

    See http://shapelib.maptools.org/. The shape files used in this exercise were created using a .NET wrapper that you can obtain from the ShapeLib site. The .NET wrapper package contains test code that was easily adapted to the purpose of creating shape files for the schema mapping exercise.

    The shape files used for the purpose of mapping FDO logical types to shape native types were created using the following method. The path argument is the path to a filename whose pattern is <base>.shp. The type argument specifies the type of the shape file’s geometry, for example, ShapLib.ShapeType.Point. Execution of the method creates the named <base>.shp file as well as a <base>.shx file.

    using MapTools;
    public bool CreateShpFile(string path, ShapeLib.ShapeType type)
    {
    	IntPtr hShp = ShapeLib.SHPCreate(path, type);
    	if (hShp.Equals(IntPtr.Zero)) return false;
    	else
    	{
    		ShapeLib.SHPClose(hShp);
    		return true;
    	} }
    

    The FDO ApplySchema creates the <base>.dbf and <base>.cpg. It will also create the <base>.prj file if a spatial context has been created and the name of the coordinate system referenced by the spatial context definition has been assigned to the feature geometric property definition’s spatial context association property.