Re: [OpenMap Users] shapefiles - getting the outerRing

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Tue, 23 Nov 2010 10:22:15 -0500

Hi,

I believe the outer ring is the first one in the array, and that
coordinates are always clockwise with that outer ring (its in the
shapefile specification), and change direction for the next ring, and
then back and forth for subsequent rings.

Hope this helps,

- Don


On Thu, Nov 18, 2010 at 10:26 AM, C S <usmsci_at_yahoo.com> wrote:
> Hi again all,
>
>  I was wondering if there was a way to retrieve information about the outer ring of each shapeRecord of a shapefile. It doesnt look like ESRIRecord or any of its subclasses offer any way to look into each record of a shapefile and give you info about clockwise or counter-clockwise orientation of rings. below is a small snippet of code for reference. I have done a shpdump on the shapefiles as well and there doesnt seem to be an indicator of which was would be the outer ring.
>
>  shapeFile = new ShapeFile(shpInputfile);
>  shapeCount = dbf.getRowCount();
>
> for (int i = 1; i <= shapeCount; i++) {
> ESRIPolygonRecord shapeRecord = null;
>
> shapeRecord = (ESRIPolygonRecord) shapeFile.getNextRecord();
>
> for (int polyIndex = 0; polyIndex < shapeRecord.polygons.length; polyIndex++) {
>    ESRIPoly.ESRIFloatPoly poly = (ESRIPoly.ESRIFloatPoly) shapeRecord.polygons[polyIndex];
>
> .......
>
> }
>
>
>
>
>
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Nov 23 2010 - 10:22:51 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT