Re: [OpenMap Users] raw data from shp files

From: Don Dietrick <dietrick@bbn.com>
Date: Wed Nov 13 2002 - 20:41:22 EST

Hi Arto,

You might want to look a the SpatialIndex.locateRecords() method for
tips. You can access the different ESRIPoint and ESRIPoly objects,
which hold the raw data, via the different ESRIRecord objects.

Regards,

Don

On Wednesday, November 13, 2002, at 01:22 AM, Arto Inkala wrote:

> Hello,
>
> I'm new with openmap and I'm wondering, what is the simplest way to get
> raw data from .shp files. I supposed the following code should do it:
>
>
> ----------------
> ShapeFile sh=new ShapeFile("my.shp");
> while(true) {
> ESRIRecord er=sh.getNextRecord();
> if(er==null) break;
> byte b[]=new byte[er.getBinaryStoreSize()];
> er.write(b,0);
> ESRIPolygonRecord erp=new ESRIPolygonRecord(b,0);
> ESRIPoly ep[]=erp.polygons;
> for(int n=0;n<ep.length;n++) {
> ESRIPoly.ESRIFloatPoly erf=new
> ESRIPoly.ESRIFloatPoly(ep[n].nPoints);
> erf.read(b,0,true);
> for(int p=0;p<erf.nPoints;p++)
> System.out.println(erf.getX(p)+" p "+erf.getY(p));
> }
> }
>
> --------------
>
> However there are some zero and infinity values before real pointdata
> and in some records x- and y values are changed. Have I misunderstand
> something?
>
> thanks in advance,
>
> Arto
>
> --
> [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"]
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Wed Nov 13 20:48:15 2002

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