Re: Need help with creating shape files OpenMap-4.4.1.

From: Donald Dietrick <dietrick@bbn.com>
Date: Tue Nov 20 2001 - 16:01:15 EST

Hi Scott,

There is a release scheduled for tomorrow that might fix things, but I'm
also pretty sure that the package expects that the
OMGraphics, which have to match the type of the graphic list, be
themselves in a sub-OMGraphicList which is added to the top level list.
Typing is very important, and the next release has better typing control.

- Don

On Friday, November 16, 2001, at 11:37 AM, Scott Bortman wrote:

> Hello OpenMap Users,
>
> I want to create a shape file using the OpenMap library.
> I created a bunch of OMGraphics, added them to an
> EsriGraphicList, and wrote out the .shp and .shx files.
>
> Everything seemed fine until I wanted to view them. For
> that I need to create the .ssx file by running the .shp file
> through the SpatialIndex class. It reported that 0 records
> were found so I don't think that I created the .shp and .shx
> files correctly. Below is the code I used as well the output
> of the SpatialIndex class. Can anybody out there tell what
> I'm doing wrong?
>
> Thanks,
> --scottie
>
> import java.io.*;
> import com.bbn.openmap.omGraphics.*;
> import com.bbn.openmap.plugin.esri.*;
> import com.bbn.openmap.plugin.esri.output.*;
>
> public class ShapeFileTest
> {
> public static void main( String[] args )
> throws Exception
> {
> EsriGraphicList shapes = new EsriGraphicList( 3 );
> String filename = "test";
>
> for ( int i= 0; i < 90; i++ )
> {
> OMCircle circle = new OMCircle( 0.0f, 0.0f, i );
>
> shapes.addOMGraphic( circle );
> }
>
> ShpOutputStream shpStream =
> new ShpOutputStream( new FileOutputStream( filename + ".shp"
> ) );
>
> int[][] imageData = shpStream.writeGeometry( shapes );
>
> ShxOutputStream shxStream =
> new ShxOutputStream( new FileOutputStream( filename + ".shx"
> ) );
>
> shxStream.writeIndex( imageData, shapes.getType() );
> }
> }
>
>>> java com.bbn.openmap.layer.shape.SpatialIndex -c test.ssx test.shp
> Shapefile SpatialIndex Found 0 records
> Shapefile SpatialIndex recBufSize = 100000
>
> --
> [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"]
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Tue Nov 20 15:59:36 2001

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT