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"]Received on Fri Nov 16 11:39:36 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT