Hi Brian,
On Monday, November 26, 2001, at 02:33 PM, Schlining, Brian wrote:
> Hi Don,
>
>> There's a new release impending, probably tomorrow morning that fixes
>> some bugs that I introduced in the package's debut. I'm not sure if it
>> will fix your problem, but it might? Can you let us know if it
>> doesn't?
>
> Sorry to say that the new release didn't fix the problem. I'm still
> unable to generate the Spatial indexes need to create the .shx file
> needed for shapefiles. Also, using ShpOutputStream doesn't seem to
> write any real data when I try this:
>
> File shapeDir = new File("C:\temp\somedirectory");
> File shp = new File(shapeDir, shapeDir.getName() + ".shp");
> File shx = new File(shapeDir, shapeDir.getName() + ".shx");
> OMGraphicList shapeData = new OMGraphicList();
> // Add a bunch of bunch of polylines to shapedata
> // like this. degBuf is a float[] containing
> // the lat,lon data. (i.e lat,lon,lat,lon,...)
> // This is in a loop but I've removed the loop here.
> // Start the loop
> shapeData.add(new OMPoly(
> ProjMath.arrayDegToRad(degBuf),
> OMGraphic.DECIMAL_DEGREES,
These two entries appear to be in conflict. I don't know if this
matters.
Try either:
shapeData.add(new OMPoly(degBuf, OMGraphic.DECIMAL_DEGREES,
or
shapeData.add(new OMPoly(
ProjMath.arrayDegToRad(degBuf),
OMGraphic.RADIANS,
> OMGraphic.LINETYPE_RHUMB));
> // End the loop
> EsriPolylineList shapes = new EsriPolylineList();
> shapes.add(shapeData);
> ShpOutputStream shpOut = new ShpOutputStream(
> new FileOutputStream(shp));
> int[][] shxData = shpOut.writePolyGeometry(shapes);
You can also call shpOut.writeGeometry(shapes);
and not have to know what the shape types are...
> ShxOutputStream shxOut = new ShxOutputStream(
> new FileOutputStream(shx));
> shxOut.writeIndex(shxData, EsriLayer.TYPE_POLYLINE);
>
> As far as I can tell from the documentation, this should work. Let me
> know if I'm doing something wrong or if
It looks right to me, too. Can you check the shxData? Is the array
getting created correctly?
> there's still some kinks in openmap's shapefile related classes. Also
> FYI, I can create a shapefile using
> com.bbn.openmap.layer.shape.Shapefile, but this class doesn't provide a
> mechanism for generating the spatial indices (for the .shx file).
I actually didn't know that ShapeFile could write data files. :) I
don't think that package has the type-checking that the plugin package
does, too.
- Don
>
> Cheers
> B
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Brian Schlining
> Software Application Developer
> Monterey Bay Aquarium Research Institute
> brian@mbari.org
> (831) 775-1855
> http://www.mbari.org/~brian
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Donald Dietrick, dietrick@bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Mon Nov 26 15:00:31 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT