[Shapelib] Multipatch creation error
Frank Warmerdam
warmerdam at pobox.com
Tue Sep 14 08:46:35 EST 2010
Oscar Gomez Mateu wrote:
> Hi,
>
> I am new to ShapeLib. I am ussing the .net wrapper available at the
> project webpage. I have extended the wrapper to include the
> SHPRewindObject() of version 1.2.10. My objective is to create a simple
> multipatch building representation. Having a 2D building shape with an
> elevation property, create a real 3D block (with min 6 faces) imitating
> the building extrusion. I am able to do this with many polygonZ, but
> then every building is composed of N different polygons. I want the
> whole building to be a unique multipatch feature.
>
> I am having problems with the Multipatch creation. As an example, I
> create a Multipatch composed of 2 triangles in a TriangleFan (a
> horizontal square -4points-) and a Ring (a vertical square sharing on of
> the triangles lines -5 points-).
>
> NVERTICES = 9;
> double[] bX = new double[NVERTICES] { 0, 10, 10, 0, 0,
> 0, 0, 0, 0 };
> double[] bY = new double[NVERTICES] { 0, 0, 10, 10, 0, 10,
> 10, 0, 0 };
> double[] bZ = new double[NVERTICES] { 10, 10, 10, 10, 10,
> 10, 0, 0, 10 };
> double[] bM = new double[NVERTICES] { 5, 5, 5, 5, 5, 5, 5,
> 5, 5 };
> ShapeLib.ShapeType shpType3 = ShapeLib.ShapeType.MultiPatch;
>
> int[] apartStart2 = new int[2] { 0, 4};
> ShapeLib.PartType[] apartType2 = new ShapeLib.PartType[2] {
> ShapeLib.PartType.TriangleFan, ShapeLib.PartType.Ring};
>
> pshpObj = ShapeLib.SHPCreateObject(shpType3, -1, 2,
> apartStart2, apartType2, NVERTICES, bX, bY, bZ, bM);
>
> int j = ShapeLib.SHPRewindObject(hShp, pshpObj);
> iRet = ShapeLib.SHPWriteObject(hShp, -1, pshpObj);
> ShapeLib.SHPDestroyObject(pshpObj);
>
> The resulting file (the dbf is filled in a different part of the sample
> application) is interpreted right by GlobalMapper (a simple GIS package)
> but it is not rendered (even when the load launched no errors) by ArcScene.
>
> Any idea why is this?
Oscar,
Can you provide access to the generated file and/or show the shpdump
result from this process?
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Shapelib
mailing list