[r-cran-maptools] 01/20: Import Upstream version 0.7.20
Andreas Tille
tille at debian.org
Sun Jan 15 18:55:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository r-cran-maptools.
commit 7f4749141f9314c320c42541ae04c05ae8ec95ab
Author: Andreas Tille <tille at debian.org>
Date: Sun Jan 15 19:53:25 2017 +0100
Import Upstream version 0.7.20
---
ChangeLog | 606 ++++++
DESCRIPTION | 12 +
INDEX | 61 +
LICENSE | 95 +
NAMESPACE | 68 +
R/GE_png.R | 114 +
R/Rgshhs.R | 203 ++
R/SP2owin.R | 44 +
R/Spatial-methods.R | 39 +
R/SpatialLines-methods.R | 86 +
R/SpatialPoints-methods.R | 31 +
R/SpatialPolys-methods.R | 221 ++
R/asciigrid.R | 101 +
R/azimuth.R | 52 +
R/checkHoles.R | 72 +
R/colslegs.R | 72 +
R/dotsinpolys.R | 106 +
R/elide.R | 216 ++
R/gc_dist.R | 127 ++
R/getKMLcoordinates.R | 22 +
R/kmlLine.R | 70 +
R/kmlPolygon.R | 94 +
R/maptools.R | 952 ++++++++
R/maptoolsChanges.R | 19 +
R/nowrapRecenter.R | 61 +
R/pcent.R | 21 +
R/plot.Map.R | 102 +
R/point.in.polygon.R | 12 +
R/pointLabel.R | 218 ++
R/readGPS.R | 17 +
R/readSplus.R | 85 +
R/shapelib.R | 338 +++
R/sp2Mondrian.R | 124 ++
R/sp2WB.R | 78 +
R/sp2pbs.R | 183 ++
R/sp2tmap.R | 34 +
R/sp_bind.R | 205 ++
R/sp_spat1.R | 71 +
R/sp_tools.R | 145 ++
R/spatstat1.R | 120 +
R/spmaps.R | 107 +
R/subset.R | 33 +
R/sun-methods.R | 189 ++
R/sun.R | 512 +++++
R/union.R | 58 +
R/zzz.R | 8 +
data/gpcholes.rda | Bin 0 -> 405 bytes
data/wrld_simpl.rda | Bin 0 -> 355060 bytes
inst/ChangeLog | 606 ++++++
inst/LICENSE | 103 +
inst/changes | 37 +
inst/grids/simple.ag | 10 +
inst/grids/test.ag | 121 ++
inst/shapes/baltim.dbf | Bin 0 -> 31595 bytes
inst/shapes/baltim.shp | Bin 0 -> 6008 bytes
inst/shapes/baltim.shx | Bin 0 -> 1788 bytes
inst/shapes/columbus.dbf | Bin 0 -> 10082 bytes
inst/shapes/columbus.shp | Bin 0 -> 21980 bytes
inst/shapes/columbus.shx | Bin 0 -> 492 bytes
inst/shapes/fylk-val-ll.dbf | Bin 0 -> 19397 bytes
inst/shapes/fylk-val-ll.shp | Bin 0 -> 24588 bytes
inst/shapes/fylk-val-ll.shx | Bin 0 -> 876 bytes
inst/shapes/fylk-val.dbf | Bin 0 -> 10151 bytes
inst/shapes/fylk-val.shp | Bin 0 -> 24588 bytes
inst/shapes/fylk-val.shx | Bin 0 -> 876 bytes
inst/shapes/pointZ.dbf | Bin 0 -> 38593 bytes
inst/shapes/pointZ.prj | 1 +
inst/shapes/pointZ.shp | Bin 0 -> 17700 bytes
inst/shapes/pointZ.shx | Bin 0 -> 3300 bytes
inst/shapes/sids.dbf | Bin 0 -> 17282 bytes
inst/shapes/sids.shp | Bin 0 -> 46196 bytes
inst/shapes/sids.shx | Bin 0 -> 900 bytes
inst/share/Splus.map | 27 +
inst/share/co37_d90.e00 | 5046 +++++++++++++++++++++++++++++++++++++++++++
inst/share/gshhs_c.b | Bin 0 -> 163512 bytes
inst/share/nc_xtra.dbf | Bin 0 -> 11025 bytes
inst/share/wdb_borders_c.b | Bin 0 -> 71448 bytes
man/ContourLines2SLDF.Rd | 51 +
man/GE_SpatialGrid.Rd | 66 +
man/Map2poly.Rd | 92 +
man/Rgshhs.Rd | 70 +
man/SpatialLines2PolySet.Rd | 59 +
man/as.ppp.Rd | 127 ++
man/asciigrid.Rd | 57 +
man/checkPolygonsHoles.Rd | 61 +
man/dotsInPolys.Rd | 61 +
man/elide-methods.Rd | 85 +
man/gcDestination.Rd | 56 +
man/get.Pcent.Rd | 26 +
man/getKMLcoordinates.Rd | 38 +
man/gzAzimuth.Rd | 44 +
man/holepolys.Rd | 47 +
man/kmlLine.Rd | 69 +
man/kmlOverlay.Rd | 57 +
man/kmlPolygon.Rd | 86 +
man/map2SpatialPolygons.Rd | 59 +
man/maptools.Rd | 25 +
man/nowrapRecenter.Rd | 54 +
man/pal2SpatialPolygons.Rd | 56 +
man/plot.Map.Rd | 58 +
man/plot.polylist.Rd | 66 +
man/pointLabel.Rd | 103 +
man/ppp.Rd | 12 +
man/read.shape.Rd | 43 +
man/readGPS.Rd | 51 +
man/readShapeLines.Rd | 52 +
man/readShapePoints.Rd | 49 +
man/readShapePoly.Rd | 56 +
man/readShapeSpatial.Rd | 65 +
man/readSplus.Rd | 37 +
man/sp2Mondrian.Rd | 33 +
man/sp2WB.Rd | 41 +
man/sp2tmap.Rd | 39 +
man/spCbind-methods.Rd | 48 +
man/spChFIDs-methods.Rd | 39 +
man/spRbind-methods.Rd | 48 +
man/subset.polylist.Rd | 33 +
man/sun-methods.Rd | 170 ++
man/symbolsInPolys.Rd | 56 +
man/unionSpatialPolygons.Rd | 34 +
man/write.linelistShape.Rd | 48 +
man/write.pointShape.Rd | 48 +
man/write.polylistShape.Rd | 50 +
man/wrld_simpl.Rd | 38 +
src/Rcentroid.c | 274 +++
src/Rgshhs.c | 378 ++++
src/Rgshhs.h | 80 +
src/Rshapeget.c | 248 +++
src/Rshapeinfo.c | 98 +
src/Rshapewrite.c | 55 +
src/Rshapewrite1.c | 190 ++
src/insiders.c | 73 +
src/maptools.h | 13 +
src/pip.c | 203 ++
src/shapefil.h | 528 +++++
src/shpopen.c | 2031 +++++++++++++++++
src/shptree.c | 986 +++++++++
137 files changed, 19975 insertions(+)
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..ae93186
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,606 @@
+2009-02-18 12:58 rsbivand
+
+ * inst/shapes/fylk-val-ll.dbf, inst/shapes/fylk-val-ll.shp,
+ inst/shapes/fylk-val-ll.shx, data/wrld_simpl.rda: kml writing;
+ GSHHS lines shift
+
+2009-02-18 12:55 rsbivand
+
+ * ChangeLog, DESCRIPTION, INDEX, NAMESPACE, R/Rgshhs.R,
+ inst/ChangeLog, inst/LICENSE, inst/share/gshhs_c.b,
+ man/Rgshhs.Rd, R/getKMLcoordinates.R, R/kmlLine.R,
+ R/kmlPolygon.R, man/getKMLcoordinates.Rd, man/kmlLine.Rd,
+ man/kmlPolygon.Rd, man/wrld_simpl.Rd: kml writing; GSHHS lines
+ shift
+
+2009-02-05 18:45 rsbivand
+
+ * man/asciigrid.Rd: tidy
+
+2009-02-05 16:38 rsbivand
+
+ * R/readSplus.R, man/sp2WB.Rd, ChangeLog, inst/ChangeLog: adding
+ features to readSplus
+
+2009-02-05 14:38 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/readSplus.R, inst/share/Splus.map,
+ man/readSplus.Rd, ChangeLog, inst/ChangeLog: adding readSplus for
+ WinBUGS
+
+2009-01-20 15:38 rsbivand
+
+ * DESCRIPTION, R/sun-methods.R, ChangeLog, inst/ChangeLog: sun NULL
+ tz
+
+2008-11-13 15:06 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/readGPS.R, inst/ChangeLog,
+ man/readGPS.Rd: ... for readGPS()
+
+2008-11-12 15:55 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SP2owin.R, R/sp_spat1.R, R/spatstat1.R,
+ man/as.ppp.Rd, man/ppp.Rd: as.psp
+
+2008-10-02 16:46 rsbivand
+
+ * ChangeLog, inst/ChangeLog: changelog
+
+2008-08-14 11:09 rsbivand
+
+ * DESCRIPTION, INDEX, R/spmaps.R: NULL bug in maps2SP
+
+2008-06-27 10:15 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SpatialLines-methods.R,
+ R/SpatialPoints-methods.R, R/SpatialPolys-methods.R,
+ R/maptools.R, R/pcent.R, R/readGPS.R, R/shapelib.R, R/subset.R,
+ inst/changes, man/readShapePoly.Rd, R/Spatial-methods.R,
+ man/readShapeSpatial.Rd, ChangeLog, inst/ChangeLog: readSpatial
+ wrapper
+
+2008-06-19 07:56 rsbivand
+
+ * DESCRIPTION, R/sp2pbs.R: PolySet2SpatialLines UTM zone update
+
+2008-05-24 19:18 rsbivand
+
+ * ChangeLog, INDEX, inst/ChangeLog: GSHHS support to 1.10
+
+2008-05-24 18:27 rsbivand
+
+ * DESCRIPTION, R/Rgshhs.R, R/sp2pbs.R, inst/share/gshhs_c.b,
+ inst/share/wdb_borders_c.b, man/Rgshhs.Rd, src/Rgshhs.c,
+ src/Rgshhs.h: GSHHS support to 1.10
+
+2008-04-14 22:49 rsbivand
+
+ * DESCRIPTION: tidy
+
+2008-04-14 22:35 rsbivand
+
+ * ChangeLog, inst/ChangeLog: tidy
+
+2008-04-14 22:33 rsbivand
+
+ * DESCRIPTION: PolySet
+
+2008-04-13 18:47 rsbivand
+
+ * DESCRIPTION, INDEX, R/sp2pbs.R: PBS to SP SID bug
+
+2008-04-10 16:07 rsbivand
+
+ * man/readShapePoly.Rd: tidy
+
+2008-04-04 19:59 rsbivand
+
+ * DESCRIPTION, R/SpatialPolys-methods.R, man/readShapePoly.Rd: ABS
+ nulls
+
+2008-03-30 21:48 rsbivand
+
+ * DESCRIPTION, R/Rgshhs.R, man/Rgshhs.Rd: GSHHS clip
+
+2008-03-03 22:47 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/GE_png.R, R/shapelib.R, inst/ChangeLog,
+ man/GE_SpatialGrid.Rd, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd: makegrid
+
+2008-02-09 13:42 rsbivand
+
+ * DESCRIPTION, man/Rgshhs.Rd, man/SpatialLines2PolySet.Rd,
+ man/checkPolygonsHoles.Rd, man/dotsInPolys.Rd,
+ man/gcDestination.Rd, man/map2SpatialPolygons.Rd,
+ man/nowrapRecenter.Rd, man/pal2SpatialPolygons.Rd,
+ man/plot.polylist.Rd, man/pointLabel.Rd, man/readGPS.Rd,
+ man/readShapeLines.Rd, man/readShapePoints.Rd,
+ man/readShapePoly.Rd, man/sp2WB.Rd, man/sp2tmap.Rd,
+ man/sun-methods.Rd, man/symbolsInPolys.Rd,
+ man/unionSpatialPolygons.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/write.polylistShape.Rd: line lengths
+ in help
+
+2008-01-30 21:53 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/GE_png.R, man/GE_SpatialGrid.Rd: SG
+ creation
+
+2008-01-30 09:26 rsbivand
+
+ * R/elide.R: ppp + getinfo
+
+2008-01-29 12:36 rsbivand
+
+ * R/elide.R: ppp + getinfo
+
+2008-01-29 12:00 rsbivand
+
+ * R/elide.R, man/elide-methods.Rd: ppp + getinfo
+
+2008-01-29 11:37 rsbivand
+
+ * R/: sp_spat1.R, spatstat1.R: ppp + getinfo
+
+2008-01-29 10:52 rsbivand
+
+ * R/shapelib.R, R/sp_spat1.R, src/Rshapeget.c, src/Rshapeinfo.c:
+ ppp + getinfo
+
+2008-01-29 10:03 rsbivand
+
+ * src/Rshapeinfo.c: ppp + getinfo
+
+2008-01-29 09:50 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/shapelib.R, R/sp_spat1.R,
+ R/spatstat1.R, src/Rshapeinfo.c: ppp + getinfo
+
+2008-01-20 16:08 rsbivand
+
+ * ChangeLog, DESCRIPTION, NAMESPACE, R/SpatialPolys-methods.R,
+ R/sp2pbs.R, inst/ChangeLog, man/SpatialLines2PolySet.Rd: pbs to
+ sp
+
+2007-12-13 18:32 rsbivand
+
+ * DESCRIPTION, R/elide.R: elide
+
+2007-12-09 19:03 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/elide.R, inst/ChangeLog,
+ man/elide-methods.Rd, src/Rgshhs.c, src/Rgshhs.h: elide shift
+
+2007-11-21 23:37 rsbivand
+
+ * R/elide.R: elide bug
+
+2007-11-16 10:12 rsbivand
+
+ * DESCRIPTION, inst/changes, inst/share/gshhs_c.b, man/Rgshhs.Rd,
+ src/Rgshhs.c, src/Rgshhs.h, src/shpopen.c: GSHHS to 1.5
+
+2007-11-10 14:17 rsbivand
+
+ * src/: shpopen.c, shptree.c: assert
+
+2007-10-31 16:43 rsbivand
+
+ * ChangeLog, R/sp2WB.R, inst/ChangeLog: thingy to slot
+
+2007-10-31 14:46 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/SP2owin.R, R/SpatialLines-methods.R,
+ R/SpatialPolys-methods.R, R/checkHoles.R, R/dotsinpolys.R,
+ R/nowrapRecenter.R, R/sp2WB.R, R/sp2pbs.R, R/union.R,
+ inst/ChangeLog, inst/changes, man/checkPolygonsHoles.Rd,
+ man/dotsInPolys.Rd, man/gcDestination.Rd,
+ man/map2SpatialPolygons.Rd, man/pal2SpatialPolygons.Rd,
+ man/readShapePoly.Rd, man/symbolsInPolys.Rd,
+ man/unionSpatialPolygons.Rd: thingy to slot
+
+2007-10-23 14:50 rsbivand
+
+ * DESCRIPTION, LICENSE, inst/LICENSE, inst/changes,
+ man/Map2poly.Rd, man/as.ppp.Rd, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd: license
+
+2007-10-10 08:25 rsbivand
+
+ * ChangeLog, INDEX, inst/ChangeLog, inst/changes: tidy
+
+2007-10-06 19:38 rsbivand
+
+ * man/gcDestination.Rd: elide first cut
+
+2007-10-06 12:05 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/elide.R, R/gc_dist.R,
+ man/elide-methods.Rd: elide first cut
+
+2007-09-29 18:37 rsbivand
+
+ * R/pointLabel.R: pointLabel update
+
+2007-09-26 11:09 rsbivand
+
+ * R/asciigrid.R: Ascii Grid dec
+
+2007-09-18 10:19 rsbivand
+
+ * ChangeLog, inst/ChangeLog, inst/changes: tidy
+
+2007-09-18 10:15 rsbivand
+
+ * DESCRIPTION, R/maptools.R, R/sp2WB.R: tidy
+
+2007-09-14 22:14 rsbivand
+
+ * R/sp2Mondrian.R, man/sp2Mondrian.Rd: Mondrian new format
+
+2007-09-14 08:58 rsbivand
+
+ * DESCRIPTION, R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/shapelib.R, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd,
+ man/write.linelistShape.Rd, man/write.pointShape.Rd,
+ man/write.polylistShape.Rd: pass through max_nchar
+
+2007-09-05 18:07 rsbivand
+
+ * DESCRIPTION, R/spmaps.R, ChangeLog, inst/ChangeLog, inst/changes:
+ double NA at end of map coords
+
+2007-07-25 10:49 rsbivand
+
+ * man/write.polylistShape.Rd: 3D polylist, write line shape, owin
+ poly
+
+2007-07-19 21:33 rsbivand
+
+ * DESCRIPTION, R/SP2owin.R, R/maptools.R, R/shapelib.R,
+ inst/changes, man/as.ppp.Rd, man/write.linelistShape.Rd,
+ man/write.polylistShape.Rd, src/Rshapewrite1.c: 3D polylist
+ writing
+
+2007-06-11 10:05 rsbivand
+
+ * DESCRIPTION: encoding
+
+2007-06-10 23:27 rsbivand
+
+ * ChangeLog, INDEX, inst/ChangeLog, inst/changes, man/Map2poly.Rd,
+ man/sp2WB.Rd: encode
+
+2007-06-10 22:47 rsbivand
+
+ * ChangeLog, DESCRIPTION, NAMESPACE, R/pointLabel.R,
+ inst/ChangeLog, man/pointLabel.Rd: pointLabel
+
+2007-06-05 15:31 rsbivand
+
+ * INDEX, R/readGPS.R: con correction
+
+2007-05-08 18:35 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/sp_spat1.R, man/as.ppp.Rd: revert
+ spatstat coerce
+
+2007-05-07 10:55 rsbivand
+
+ * man/readGPS.Rd: tidy
+
+2007-04-28 21:41 rsbivand
+
+ * man/readShapePoints.Rd: doc error
+
+2007-04-27 18:37 rsbivand
+
+ * man/readGPS.Rd: resolve GPS conflict
+
+2007-04-21 06:27 rsbivand
+
+ * DESCRIPTION, INDEX, R/GE_png.R: GE dimnames
+
+2007-04-16 06:01 rsbivand
+
+ * man/readGPS.Rd: sp problem and gps
+
+2007-04-16 04:40 rsbivand
+
+ * DESCRIPTION, R/readGPS.R, R/spmaps.R, man/readGPS.Rd: sp problem
+ and gps
+
+2007-03-29 16:34 rsbivand
+
+ * inst/changes: tidy
+
+2007-03-23 18:50 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/plot.Map.R, R/readGPS.R,
+ man/readGPS.Rd: readGPS
+
+2007-02-09 21:09 rsbivand
+
+ * R/SpatialPolys-methods.R, man/readShapePoly.Rd: force_ring in
+ readShapePoly
+
+2007-02-01 15:28 rsbivand
+
+ * DESCRIPTION, INDEX, R/sun-methods.R, man/plot.Map.Rd,
+ man/plot.polylist.Rd, man/sun-methods.Rd: sun manual tidy
+
+2007-01-21 11:50 rsbivand
+
+ * man/: GE_SpatialGrid.Rd, kmlOverlay.Rd: GE_PNG additions
+
+2007-01-20 22:35 rsbivand
+
+ * DESCRIPTION, NAMESPACE, inst/changes, R/GE_png.R,
+ man/GE_SpatialGrid.Rd, man/kmlOverlay.Rd: GE_PNG additions
+
+2007-01-16 10:39 rsbivand
+
+ * INDEX: im and sun-methods
+
+2007-01-16 10:23 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/sp_spat1.R, inst/changes,
+ man/as.ppp.Rd, man/crepuscule-methods.Rd, man/ppp.Rd,
+ man/solarnoon-methods.Rd, man/solarpos-methods.Rd,
+ man/sun-methods.Rd, man/sunriset-methods.Rd: im and sun-methods
+
+2006-12-02 16:38 rsbivand
+
+ * DESCRIPTION, INDEX, man/solarnoon-methods.Rd: release
+
+2006-11-22 13:03 rsbivand
+
+ * R/Rgshhs.R: Rgshhs
+
+2006-11-16 15:34 rsbivand
+
+ * R/sp_bind.R, inst/share/nc_xtra.dbf, man/spCbind-methods.Rd,
+ man/spChFIDs-methods.Rd, man/spRbind-methods.Rd: bind
+
+2006-11-16 15:31 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/sp2pbs.R, man/Rgshhs.Rd,
+ man/map2SpatialPolygons.Rd, man/plot.polylist.Rd,
+ man/read.shape.Rd, man/subset.polylist.Rd, src/Rgshhs.c: bind
+
+2006-10-31 14:06 rsbivand
+
+ * NAMESPACE, R/SP2owin.R, R/sp_tools.R, R/sun.R, inst/changes,
+ inst/share/co37_d90.e00, inst/share/gshhs_c.b, R/Rgshhs.R,
+ R/checkHoles.R, R/nowrapRecenter.R, R/union.R, man/Rgshhs.Rd,
+ man/checkPolygonsHoles.Rd, man/nowrapRecenter.Rd,
+ man/pal2SpatialPolygons.Rd, man/unionSpatialPolygons.Rd,
+ src/Rgshhs.c, src/Rgshhs.h: sun and r-spatial integration
+
+2006-10-31 09:29 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/sun.R, R/zzz.R, R/SP2owin.R,
+ R/sp2pbs.R, R/sp_spat1.R, R/sp_tools.R, R/spatstat1.R,
+ R/spmaps.R, R/sun-methods.R, man/ContourLines2SLDF.Rd,
+ man/SpatialLines2PolySet.Rd, man/as.ppp.Rd,
+ man/crepuscule-methods.Rd, man/map2SpatialPolygons.Rd,
+ man/ppp.Rd, man/solarnoon-methods.Rd, man/solarpos-methods.Rd,
+ man/sun.Rd, man/sunriset-methods.Rd: sun and r-spatial
+ integration
+
+2006-10-29 14:53 rsbivand
+
+ * R/sun.R: sun ephemerides
+
+2006-10-28 21:56 rsbivand
+
+ * R/sun.R: sun ephemerides
+
+2006-10-28 19:23 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/sun.R, inst/changes, man/sun.Rd:
+ sun ephemerides
+
+2006-10-19 22:03 rsbivand
+
+ * DESCRIPTION, R/dotsinpolys.R, inst/changes: dostInPolys NULL
+
+2006-09-21 21:42 rsbivand
+
+ * DESCRIPTION: R 2.4.0
+
+2006-08-30 16:50 rsbivand
+
+ * DESCRIPTION, src/Rshapewrite1.c: pointZ
+
+2006-08-30 08:59 rsbivand
+
+ * DESCRIPTION, LICENSE, R/maptools.R, R/shapelib.R, inst/LICENSE,
+ inst/changes, man/readShapePoints.Rd, src/Rshapewrite.c,
+ inst/shapes/pointZ.dbf, inst/shapes/pointZ.prj,
+ inst/shapes/pointZ.shp, inst/shapes/pointZ.shx: pointZ
+
+2006-05-02 09:07 rsbivand
+
+ * DESCRIPTION, R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/shapelib.R, inst/changes,
+ man/read.shape.Rd, man/readShapeLines.Rd, man/readShapePoints.Rd,
+ man/readShapePoly.Rd, src/Rshapeget.c: Geolytics bug
+
+2006-04-10 21:21 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/asciigrid.R, R/azimuth.R, R/sp2WB.R,
+ inst/changes, man/asciigrid.Rd, man/dotsInPolys.Rd,
+ man/gzAzimuth.Rd: fix to sp2WB, readAsciiGrid, writeAsciiGrid
+
+2006-03-20 09:32 rsbivand
+
+ * DESCRIPTION, R/sp2Mondrian.R, man/sp2Mondrian.Rd: Mondrian
+
+2006-03-10 13:49 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/asciigrid.R, R/sp2tmap.R,
+ inst/changes, man/asciigrid.Rd, man/sp2WB.Rd, R/azimuth.R,
+ R/sp2Mondrian.R, man/gzAzimuth.Rd, man/sp2Mondrian.Rd:
+ sp2Mondrian
+
+2006-03-01 09:53 rsbivand
+
+ * DESCRIPTION, INDEX, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/plot.Map.R, R/shapelib.R,
+ inst/changes, man/plot.Map.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/write.polylistShape.Rd,
+ src/Rshapeget.c: checks on polylists
+
+2006-01-11 12:08 rsbivand
+
+ * R/sp2tmap.R, man/sp2tmap.Rd: tmap
+
+2006-01-10 14:08 rsbivand
+
+ * R/sp2tmap.R, man/sp2tmap.Rd: tmap
+
+2006-01-09 14:33 rsbivand
+
+ * NAMESPACE, man/sp2tmap.Rd: sp2tmap
+
+2006-01-08 22:23 rsbivand
+
+ * man/sp2tmap.Rd: adding sp2tmap
+
+2006-01-08 19:34 rsbivand
+
+ * DESCRIPTION, R/sp2WB.R, R/sp2tmap.R, man/asciigrid.Rd,
+ man/sp2tmap.Rd: adding sp2tmap
+
+2005-12-15 16:00 rsbivand
+
+ * INDEX: to 5-4
+
+2005-12-12 22:27 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/shapelib.R, R/sp2WB.R, inst/changes,
+ man/readShapePoly.Rd, man/sp2WB.Rd, man/write.pointShape.Rd:
+ sp2WB
+
+2005-10-03 19:44 rsbivand
+
+ * DESCRIPTION, R/SpatialLines-methods.R, inst/changes: lines bugs
+
+2005-09-14 23:08 rsbivand
+
+ * R/SpatialPolys-methods.R: as at 0.5-2
+
+2005-09-13 19:24 rsbivand
+
+ * man/: dotsInPolys.Rd, symbolsInPolys.Rd: remove suggested splancs
+
+2005-09-13 16:53 rsbivand
+
+ * DESCRIPTION, R/dotsinpolys.R, man/dotsInPolys.Rd,
+ man/plot.Map.Rd, man/readShapePoly.Rd, man/symbolsInPolys.Rd:
+ remove suggested splancs
+
+2005-09-09 16:28 rsbivand
+
+ * R/plot.Map.R: ... in plot.Map
+
+2005-09-08 22:28 rsbivand
+
+ * INDEX, R/SpatialPolys-methods.R, R/dotsinpolys.R,
+ man/dotsInPolys.Rd: dotsinpolys begun
+
+2005-09-08 13:11 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/maptools.R, R/shapelib.R: codetools
+
+2005-09-05 14:54 rsbivand
+
+ * man/asciigrid.Rd: links
+
+2005-09-05 11:00 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SpatialLines-methods.R,
+ R/SpatialPoints-methods.R, R/SpatialPolys-methods.R,
+ R/asciigrid.R, man/asciigrid.Rd, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd,
+ man/read_ShapeLines.Rd, man/read_ShapePoints.Rd,
+ man/read_ShapePoly.Rd: removing _
+
+2005-09-03 18:19 rsbivand
+
+ * inst/changes, man/read_ShapeLines.Rd, man/read_ShapePoly.Rd:
+ added ... to degAxis()
+
+2005-09-02 09:40 rsbivand
+
+ * NAMESPACE, R/asciigrid.R, man/asciigrid.Rd: more asciigrid
+
+2005-09-01 20:26 rsbivand
+
+ * inst/: shapes/fylk-val.shp, shapes/fylk-val.shx, grids/simple.ag,
+ shapes/sids.shp, shapes/sids.shx, grids/test.ag: Initial import.
+
+2005-09-01 20:26 rsbivand
+
+ * inst/: shapes/fylk-val.shp, shapes/fylk-val.shx, grids/simple.ag,
+ shapes/sids.shp, shapes/sids.shx, grids/test.ag: Initial revision
+
+2005-09-01 20:21 rsbivand
+
+ * R/SpatialPolys-methods.R, man/Map2poly.Rd, man/dotsInPolys.Rd,
+ man/get.Pcent.Rd, man/holepolys.Rd, man/maptools.Rd,
+ man/plot.Map.Rd, man/plot.polylist.Rd, man/read.shape.Rd,
+ man/read_ShapeLines.Rd, man/subset.polylist.Rd,
+ man/symbolsInPolys.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/asciigrid.Rd,
+ man/read_ShapePoints.Rd, man/read_ShapePoly.Rd,
+ man/write.polylistShape.Rd, src/Rcentroid.c, src/Rshapeget.c,
+ src/Rshapeinfo.c, src/Rshapewrite.c, src/insiders.c,
+ src/maptools.h, src/Rshapewrite1.c, src/shapefil.h,
+ src/shpopen.c, src/shptree.c, data/gpcholes.rda, inst/LICENSE,
+ inst/changes, inst/shapes/sids.dbf, src/pip.c,
+ inst/shapes/baltim.dbf, inst/shapes/baltim.shp,
+ inst/shapes/baltim.shx, inst/shapes/columbus.dbf,
+ inst/shapes/fylk-val.dbf, inst/shapes/columbus.shp,
+ inst/shapes/columbus.shx: Initial import.
+
+2005-09-01 20:21 rsbivand
+
+ * R/SpatialPolys-methods.R, man/Map2poly.Rd, man/dotsInPolys.Rd,
+ man/get.Pcent.Rd, man/holepolys.Rd, man/maptools.Rd,
+ man/plot.Map.Rd, man/plot.polylist.Rd, man/read.shape.Rd,
+ man/read_ShapeLines.Rd, man/subset.polylist.Rd,
+ man/symbolsInPolys.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/asciigrid.Rd,
+ man/read_ShapePoints.Rd, man/read_ShapePoly.Rd,
+ man/write.polylistShape.Rd, src/Rcentroid.c, src/Rshapeget.c,
+ src/Rshapeinfo.c, src/Rshapewrite.c, src/insiders.c,
+ src/maptools.h, src/Rshapewrite1.c, src/shapefil.h,
+ src/shpopen.c, src/shptree.c, data/gpcholes.rda, inst/LICENSE,
+ inst/changes, inst/shapes/sids.dbf, src/pip.c,
+ inst/shapes/baltim.dbf, inst/shapes/baltim.shp,
+ inst/shapes/baltim.shx, inst/shapes/columbus.dbf,
+ inst/shapes/fylk-val.dbf, inst/shapes/columbus.shp,
+ inst/shapes/columbus.shx: Initial revision
+
+2005-09-01 20:18 rsbivand
+
+ * DESCRIPTION, INDEX, LICENSE, NAMESPACE, R/shapelib.R,
+ R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/asciigrid.R, R/colslegs.R, R/dotsinpolys.R, R/maptools.R,
+ R/maptoolsChanges.R, R/pcent.R, R/plot.Map.R,
+ R/point.in.polygon.R, R/subset.R, R/zzz.R: Initial import.
+
+2005-09-01 20:18 rsbivand
+
+ * DESCRIPTION, INDEX, LICENSE, NAMESPACE, R/shapelib.R,
+ R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/asciigrid.R, R/colslegs.R, R/dotsinpolys.R, R/maptools.R,
+ R/maptoolsChanges.R, R/pcent.R, R/plot.Map.R,
+ R/point.in.polygon.R, R/subset.R, R/zzz.R: Initial revision
+
diff --git a/DESCRIPTION b/DESCRIPTION
new file mode 100644
index 0000000..e3093b4
--- /dev/null
+++ b/DESCRIPTION
@@ -0,0 +1,12 @@
+Package: maptools
+Version: 0.7-20
+Date: 2009-02-18
+Title: Tools for reading and handling spatial objects
+Encoding: latin1
+Author: Nicholas J. Lewin-Koh and Roger Bivand, contributions by Edzer J. Pebesma, Eric Archer, Adrian Baddeley, Hans-Jörg Bibiko, Stéphane Dray, David Forrest, Patrick Giraudoux, Duncan Golicher, Virgilio Gómez Rubio, Patrick Hausmann, Thomas Jagger, Sebastian P. Luque, Don MacQueen, Andrew Niccolai and Tom Short
+Maintainer: Roger Bivand <Roger.Bivand at nhh.no>
+Depends: R (>= 2.4), foreign (>= 0.8), sp (>= 0.9-7), methods
+Suggests: spatstat, PBSmapping, maps, gpclib, RArcInfo
+Description: Set of tools for manipulating and reading geographic data, in particular ESRI shapefiles; C code used from shapelib. It includes binary access to GSHHS shoreline files. The package also provides interface wrappers for exchanging spatial objects with packages such as PBSmapping, spatstat, maps, RArcInfo, Stata tmap, WinBUGS, Mondrian, and others.
+License: GPL (>= 2)
+Packaged: Wed Feb 18 13:02:58 2009; rsb
diff --git a/INDEX b/INDEX
new file mode 100644
index 0000000..512cc13
--- /dev/null
+++ b/INDEX
@@ -0,0 +1,61 @@
+as.owin.SpatialGridDataFrame
+ coercion between sp objects and spatstat
+ objects
+checkPolygonsHoles Check holes in Polygons objects
+ContourLines2SLDF Converter functions to build
+ SpatialLinesDataFrame objects
+crepuscule Methods for sun ephemerides calculations
+dotsInPolys Put dots in polygons
+elide-methods Methods for Function elide in Package
+ 'maptools'
+gcDestination Find destination in geographical coordinates
+GE_SpatialGrid Create SpatialGrid for PNG output to GE
+getKMLcoordinates Get a list of coordinates out of a KML file
+get.Pcent Polygon centroids
+gpcholes Hisaji Ono's lake/hole problem
+gzAzimuth Find azimuth for geographical coordinates
+kmlLine Create and write a KML file on the basis of a
+ given Lines object
+kmlOverlay Create and write KML file for PNG image overlay
+kmlPolygon Create and write a KML file on the basis of a
+ given Polygons object
+Map2poly Create polygon lists and bounding boxes from
+ imported shapefiles
+map2SpatialPolygons Convert map objects to sp classes
+maptools Report version information and changes
+nowrapRecenter Break polygons at meridian for recentering
+pal2SpatialPolygons Making SpatialPolygons objects from RArcInfo
+ input
+plot.Map Plot a Map object (deprecated)
+plot.polylist Plot polygons
+pointLabel Label placement for points to avoid overlaps
+ppp-class Virtual class "ppp"
+readAsciiGrid read/write to/from (ESRI) asciigrid format
+readGPS GPSbabel read interface
+read.shape Read shapefile into Map object
+readShapeLines Read arc shape files into SpatialLinesDataFrame
+ objects
+readShapePoints Read points shape files into
+ SpatialPointsDataFrame objects
+readShapePoly Read polygon shape files into
+ SpatialPolygonsDataFrame objects
+readShapeSpatial Read shape files into Spatial*DataFrame objects
+readSplus Read exported WinBUGS maps
+Rgshhs Read GSHHS data into sp object
+sp2Mondrian write map data for Mondrian
+sp2tmap Convert SpatialPolygons object for Stata tmap
+ command
+sp2WB Export SpatialPolygons object as S-Plus map for
+ WinBUGS
+SpatialLines2PolySet Convert sp line and polygon objects to
+ PBSmapping PolySet objects
+spCbind-methods cbind for spatial objects
+spChFIDs-methods change feature IDs in spatial objects
+spRbind-methods rbind for spatial objects
+subset.polylist Subset polygon list objects
+symbolsInPolys Place grids of points over polygons
+unionSpatialPolygons Aggregate Polygons in a SpatialPolygons object
+write.linelistShape Write a arc-type shapefile
+write.pointShape Write a point-type shapefile
+write.polylistShape Write a polygon-type shapefile
+wrld_simpl Simplified world country polygons
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..da74fb6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,95 @@
+This file is intended to clarify ownership and copyright: where
+possible individual files also carry brief copyright notices.
+
+Copyrights
+==========
+
+Files: src/shapefil.h, src/shpopen.c and src/shptree.c are
+copyright (c) 1998 Frank Warmerdam, and released under the conditions
+given in http://shapelib.maptools.org/license.html. His code is available
+under the MIT or LGPL licence, and the latter is chosen here.
+
+This software is available under the following "MIT Style" license, or
+at the option of the licensee under the LGPL (see LICENSE.LGPL). This
+option is discussed in more detail in shapelib.html.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Further details of Shapelib may be found at its website
+
+http://shapelib.maptools.org/
+
+It is the intention of the package maintainer to migrate to linking
+against an external shapelib, rather than incoroprating complete files
+unchanged in this package.
+
+Files: src/Rcentroid.c, src/Rshapeinfo.c, src/maptools.h, and
+src/Rshapeget.c are copyright (c) 2000-2001 by Nicholas Lewin-Koh and are
+subject to the licence at the foot of this file. Some portions of these
+files are based on shapelib/contrib files, and copyright and license
+conditions follow from the included code: RingCentroid_2d, shpcat.c,
+shpinfo.c, and SHPRingDir_2d Copyright (c) 1999, Carl Anderson
+
+Files: inst/shapes/baltim.*, inst/shapes/columbus.*, and inst/shapes/sids.*
+are derived by permission from SAL data files
+prepared by Luc Anselin; they were downloaded from:
+
+http://sal.agecon.uiuc.edu/stuff/data.html
+
+under the following conditions: "The data are provided as is, without
+any warranties. Please make sure to give proper credit when using
+them in any publications. Some of the data sets are purely illustrative
+and should not be used for substantive research."
+
+Files: inst/shapes/fylk-val.* are copyright Statens Kartverk 2001, and
+were released (with a collection of other shapefiles) to the public domain
+in July 2001. The link to the relevant page under http://www.statkart.no
+has now expired, this copy downloaded 13 July 2001.
+
+Files: inst/shapes/pointZ.* are a sample of points from a 3D point shapefile
+kindly contributed by Michael Toews to be used here for illustrative purposes;
+this sample is written out using writePointsShape().
+
+All other files are copyright (c) 2001-2004 Roger S. Bivand and Nicholas
+Lewin-Koh, and are subject to the licence at the foot of this file.
+
+Licence
+=======
+
+ This is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+
+The file COPYING in the R top-level directory is a copy of the "GNU
+General Public License".
+
+Roger.Bivand at nhh.no
+
+
diff --git a/NAMESPACE b/NAMESPACE
new file mode 100644
index 0000000..1f18220
--- /dev/null
+++ b/NAMESPACE
@@ -0,0 +1,68 @@
+useDynLib(maptools)
+
+import(sp)
+import(foreign)
+
+export(leglabs, plotpolys, shape2poly, shape2lines,
+ shape2points, shape2bbs, Map2poly, Map2poly1, Map2lines, Map2points,
+ Map2bbs, convert.pl, get.Pcent, read.shape, getinfo.shape,
+ plot.Map, plot.polylist, subset.polylist, maptools, dotsInPolys,
+ symbolsInPolys, write.pointShape, write.polylistShape,
+ write.linelistShape, print.shapehead)
+
+export(readShapePoints, readShapeLines, readShapePoly)
+
+export(writePointsShape, writeLinesShape, writePolyShape)
+
+export(readShapeSpatial, writeSpatialShape)
+
+export(readAsciiGrid, writeAsciiGrid)
+
+export(readGPS)
+
+export(sp2WB, sp2tmap, sp2Mondrian, readSplus)
+
+export(gzAzimuth, trackAzimuth)
+
+export(MapGen2SL, ArcObj2SLDF, ContourLines2SLDF, pal2SpatialPolygons)
+
+exportClass(ppp, im, owin, psp)
+
+exportMethods("crepuscule", "sunriset", "solarnoon", "solarpos")
+
+export(SpatialPolygons2PolySet, SpatialLines2PolySet, PolySet2SpatialPolygons, PolySet2SpatialLines, map2SpatialPolygons, map2SpatialLines, pruneMap)
+
+export(as.ppp.SpatialPoints, as.ppp.SpatialPointsDataFrame, as.SpatialPoints.ppp, as.SpatialPointsDataFrame.ppp, as.SpatialGridDataFrame.ppp)
+export(as.owin.SpatialGridDataFrame, as.owin.SpatialPixelsDataFrame, as.owin.SpatialPolygons, as.SpatialGridDataFrame.im, as.im.SpatialGridDataFrame)
+
+export(as.psp.SpatialLinesDataFrame, as.psp.SpatialLines, as.psp.Lines, as.psp.Line)
+
+export(unionSpatialPolygons, nowrapSpatialPolygons, nowrapRecenter, checkPolygonsHoles)
+
+export(Rgshhs)
+
+exportMethods(coerce, spCbind, spRbind, spChFIDs)
+exportMethods(elide)
+
+export(GE_SpatialGrid, kmlOverlay, Sobj_SpatialGrid)
+
+export(kmlPolygon, kmlLine, getKMLcoordinates)
+
+export(pointLabel, gcDestination)
+
+S3method(plot, Map)
+S3method(plot, polylist)
+S3method(subset, polylist)
+S3method(print, shapehead)
+#S3method(as.ppp, SpatialPoints)
+#S3method(as.ppp, SpatialPointsDataFrame)
+#S3method(as.owin, SpatialGridDataFrame)
+#S3method(as.owin, SpatialPixelsDataFrame)
+#S3method(as.owin, SpatialPolygons)
+#S3method(as.SpatialPoints, ppp)
+#S3method(as.SpatialPointsDataFrame, ppp)
+#S3method(as.SpatialGridDataFrame, ppp)
+#S3method(as.SpatialGridDataFrame, im)
+
+
+
diff --git a/R/GE_png.R b/R/GE_png.R
new file mode 100644
index 0000000..84e5a6d
--- /dev/null
+++ b/R/GE_png.R
@@ -0,0 +1,114 @@
+# Copyright (c) 2007 by Duncan Golicher, David Forrest and Roger Bivand
+#
+# GE_SpatialGrid: function collecting and processing metadata for opening
+# a PNG device to plot a Spatial* object for export to GE.
+#
+# arguments: obj: the Spatial* object; asp: if NA will be set to the latitude
+# corrected value; maxPixels: the maximum dimension of the output PNG.
+#
+# values: returns a list containing:
+# height and width (passed to png());
+# SG (a SpatialGrid object with the grid topology of the output PNG);
+# asp (the aspect value used);
+# and xlim and ylim taken from SG.
+#
+# These include the subcell inflation caused by rounding up the
+# aspect-adjusted height or width, so that bbox(SG) is larger that
+# bbox(obj) in one and only one value
+
+GE_SpatialGrid <- function(obj, asp=NA, maxPixels=600) {
+ if (!extends(class(obj), "Spatial"))
+ stop("GE_SpatialGrid only works for class(es extending) Spatial")
+ p4s <- proj4string(obj)
+ if (is.na(p4s) || is.projected(obj))
+ stop("Spatial* object must be in geographical coordinates")
+ xlim <- bbox(obj)[1,]
+ ylim <- bbox(obj)[2,]
+ s <- ifelse(is.na(asp), cos((mean(ylim) * pi)/180), asp)
+ res <- Sobj_SpatialGrid(obj, asp=s, maxDim=maxPixels)
+ class(res) <- "GE_SG"
+ res
+}
+
+Sobj_SpatialGrid <- function(obj, asp=1, maxDim=100, n=NULL) {
+ if (!extends(class(obj), "Spatial"))
+ stop("Sobj_SpatialGrid only works for class(es extending) Spatial")
+ p4s <- proj4string(obj)
+ xlim <- bbox(obj)[1,]
+ ylim <- bbox(obj)[2,]
+ m_asp <- (diff(ylim)/diff(xlim)) / asp
+ names(m_asp) <- NULL
+ if (!is.null(n)) {
+ if (m_asp < 1) maxDim <- ceiling(sqrt(n/m_asp))
+ else maxDim <- ceiling(sqrt(n*m_asp))
+ }
+ mywidth <- myheight <- maxDim
+ if (m_asp < 1) {
+ myheight1 <- mywidth * m_asp
+ myheight <- ceiling(myheight1)
+ cellsize <- c(diff(xlim)/mywidth, diff(ylim)/myheight1)
+
+ } else {
+ mywidth1 <- myheight / m_asp
+ mywidth <- ceiling(mywidth1)
+ cellsize <- c(diff(xlim)/mywidth1, diff(ylim)/myheight)
+ }
+ cells.dim <- c(mywidth, myheight)
+ cellcentre.offset <- c(xlim[1]+(0.5*cellsize[1]),
+ ylim[1]+(0.5*cellsize[2]))
+ names(cellcentre.offset) <- c("x", "y")
+ grd <- GridTopology(cellcentre.offset, cellsize, cells.dim)
+ mySG <- SpatialGrid(grd, proj4string=CRS(p4s))
+
+ res <- list(height=as.integer(myheight), width=as.integer(mywidth),
+ SG=mySG, asp=m_asp, xlim=bbox(mySG)[1,], ylim=bbox(mySG)[2,])
+ res
+}
+
+# kmlOverlay: function to write image bounding box to GE GroundOverlay
+# and link to image file to a kml file.
+#
+# arguments: obj: a GE_SG object from GE_SpatialGrid; kmlfile: If not NULL
+# the name of the kml file to be written; imagefile: the name of the PNG
+# file containing the image - this should be either relative (same
+# directory as kml file) or abosolute (fully qualified); name: the name
+# used to describe the image overlay in GE.
+#
+# values: x is a character vector containing the generated lines of the
+# kml file
+
+kmlOverlay <- function(obj, kmlfile=NULL, imagefile=NULL, name="R image") {
+ if (class(obj) != "GE_SG")
+ stop("obj must be of class GE_SG from function GE_SpatialGrid")
+ if (is.na(proj4string(obj$SG)) || is.projected(obj$SG))
+ stop("Spatial* object must be in geographical coordinates")
+ if (is.null(imagefile)) {
+ imagefile <- "<fill_in_later>"
+ warning("image file name missing, edit in manually")
+ }
+ bbox <- bbox(obj$SG)
+ W <- bbox[1,1] ; E <- bbox[1,2]
+ S <- bbox[2,1] ; N <- bbox[2,2]
+
+ kmlheader <- c("<?xml version='1.0' encoding='UTF-8'?>",
+ "<kml xmlns='http://earth.google.com/kml/2.0'>", "<GroundOverlay>")
+ kmname <- paste("<name>", name, "</name>", sep="")
+ icon <- paste("<Icon><href>", imagefile,
+ "</href><viewBoundScale>0.75</viewBoundScale></Icon>", sep="")
+ latlonbox <- paste("<LatLonBox><north>",
+ N, "</north><south>",
+ S, "</south><east>",
+ E, "</east><west>",
+ W, "</west></LatLonBox>", sep="")
+ footer <- "</GroundOverlay></kml>"
+
+ x <- (kmlheader)
+ x <- append(x, kmname)
+ x <- append(x, icon)
+ x <- append(x, latlonbox)
+ x <- append(x, footer)
+ if (!is.null(kmlfile)) cat(paste(x, sep="", collapse="\n"),
+ file=kmlfile, sep="")
+ x
+}
+
diff --git a/R/Rgshhs.R b/R/Rgshhs.R
new file mode 100644
index 0000000..375c115
--- /dev/null
+++ b/R/Rgshhs.R
@@ -0,0 +1,203 @@
+# Copyright (c) 2005-8 Roger Bivand
+
+Rgshhs <- function(fn, xlim=NULL, ylim=NULL, level=4, minarea=0,
+ shift=FALSE, verbose=TRUE, no.clip = FALSE) {
+ if (!is.character(fn)) stop("file name must be character string")
+ if (length(fn) != 1) stop("file name must be single character string")
+ dolim <- FALSE
+ dolim <- (!is.null(xlim) || !is.null(ylim))
+ if (!is.null(xlim)) lim <- xlim
+ else lim <- c(-180, 360)
+ if (!is.null(ylim)) lim <- c(lim, ylim)
+ else lim <- c(lim, c(-90, 90))
+ polydata <- .Call("Rgshhs", as.character(fn), as.integer(1),
+ as.logical(dolim), as.numeric(lim), as.integer(level),
+ as.double(minarea), PACKAGE="maptools")
+ line <- median(polydata$line)
+ if (verbose) cat("Data are", ifelse(line == 0, "polygon", "line"),
+ "data\n")
+ chosen_0 <- .Call("Rgshhs", as.character(fn), as.integer(2),
+ as.logical(dolim), as.numeric(lim), as.integer(level),
+ as.double(minarea), PACKAGE="maptools")
+ if (dolim) clip <- .Call("Rgshhs", as.character(fn), as.integer(3),
+ as.logical(dolim), as.numeric(lim), as.integer(level),
+ as.double(minarea), PACKAGE="maptools")
+ else clip <- NULL
+ polys <- .Call("Rgshhs", as.character(fn), as.integer(5),
+ as.logical(dolim), as.numeric(lim), as.integer(level),
+ as.double(minarea), PACKAGE="maptools")
+
+ Antarctica <- which(polydata$area[(chosen_0+1)] > 1.3e+07 &
+ polydata$area[(chosen_0+1)] < 1.4e+07)
+ if (length(Antarctica) == 1) {
+ if (verbose) cat("Polygon", which(chosen_0 == (Antarctica-1)),
+ "is Antarctica\n")
+ if (verbose) cat(" area", polydata$area[Antarctica], "\n")
+ if (verbose) cat(" dropping south edge to", lim[3], "\n")
+ crds <- polys[[which(chosen_0 == (Antarctica-1))]]
+# if (verbose) print(crds[c(1,2,(nrow(crds)-5):nrow(crds)),])
+ crds <- rbind(crds[1:(nrow(crds)-2),],
+ c(0, crds[(nrow(crds)-2),2]), c(0, lim[3]),
+ c(360, lim[3]), crds[1,,drop=FALSE])
+# if (verbose) print(crds[c(1,2,(nrow(crds)-5):nrow(crds)),])
+ polys[[which(chosen_0 == (Antarctica-1))]] <- crds
+ }
+
+ if (!no.clip && dolim && any(clip == 1) && line == 0) {
+ limbb <- cbind(c(lim[1], lim[1], lim[2], lim[2], lim[1]),
+ c(lim[3], lim[4], lim[4], lim[3], lim[3]))
+ require("gpclib")
+ limgp <- as(limbb, "gpc.poly")
+ which_null <- NULL
+ opolys <- vector(mode="list", length=length(polys))
+ ic <- 1
+ if (verbose) cat("Rgshhs: clipping", sum(clip), "of",
+ length(polys), "polygons ...\n")
+ for (i in seq(along=polys)) {
+ if (clip[i] == 1) {
+ tp <- as(polys[[i]], "gpc.poly")
+ rp <- gpclib:::intersect(tp, limgp)
+ l <- length(rp at pts)
+ if (l > 0) {
+ outl <- vector(mode="list", length=l)
+ for (j in 1:l)
+ outl[[j]] <- as(rp[j], "matrix")
+ opolys[[ic]] <- outl
+ if (i < length(polys)) ic <- ic+1
+ } else {
+ which_null <- c(which_null, i)
+ if (verbose) cat("null polygon: [[",i,
+ "]]\n", sep="");
+ }
+ } else {
+ opolys[[ic]] <- list(polys[[i]])
+ if (i < length(polys)) ic <- ic+1
+ }
+ }
+ polys <- opolys[1:ic]
+ } else {
+ for (i in seq(along=polys)) polys[[i]] <- list(polys[[i]])
+ which_null <- NULL
+ }
+
+ if (!is.null(which_null)) chosen_0 <- chosen_0[-which_null]
+ chosen_1 <- chosen_0+1
+ levels <- polydata$level[chosen_1]
+ if (line == 0) {
+ belongs <- matrix(1:length(chosen_1), ncol=1)
+# belonged_to <- as.numeric(rep(NA, length(chosen_1)))
+
+
+ if (level > 1 && any(levels > 1)) {
+ if (verbose) {
+ cat("Rgshhs: assigning enclosed polygons to their enclosers\n")
+ cat(" level tallies:\n")
+ print(table(levels))
+ cat("...\n")
+ }
+ mlevel <- as.integer(max(levels))
+ belongs <- matrix(rep(1:length(chosen_1), mlevel), ncol=mlevel)
+ first_time <- TRUE
+ require("gpclib")
+ for (il in mlevel:2) {
+ w_il <- which(levels == il)
+ w_il_1 <- which(levels == (il-1))
+ if (length(w_il) > 0) {
+ if (length(w_il_1) == 1) {
+ belongs[w_il, (il-1)] <- w_il_1
+ if (!first_time) {
+ prom <- which(!is.na(match(belongs[,il], w_il)))
+ belongs[prom, (il-1)] <- rep(w_il_1,
+ length(prom))
+ }
+ first_time <- FALSE
+ } else {
+ l_1 <- vector(mode="list", length=length(w_il_1))
+ for (i in 1:length(w_il_1)) {
+ ii <- w_il_1[i]
+ lp1 <- as(polys[[ii]][[1]], "gpc.poly")
+ if (length(polys[[ii]]) > 1) {
+ for (j in 2:length(polys[[ii]])) {
+ lpj <- as(polys[[ii]][[j]], "gpc.poly")
+ lp1 <- append.poly(lp1, lpj)
+ }
+ }
+ l_1[[i]] <- lp1
+ }
+ for (i in 1:length(w_il)) {
+ ii <- w_il[i]
+ lp1 <- as(polys[[ii]][[1]], "gpc.poly")
+ if (length(polys[[ii]]) > 1) {
+ for (j in 2:length(polys[[ii]])) {
+ lpj <- as(polys[[ii]][[j]], "gpc.poly")
+ lp1 <- append.poly(lp1, lpj)
+ }
+ }
+ for (j in 1:length(l_1)) {
+ tp <- gpclib:::intersect(l_1[[j]], lp1)
+ if (length(tp at pts) > 0) {
+ belongs[w_il[i], (il-1)] <- w_il_1[j]
+ if (!first_time) {
+ prom <- which(!is.na(match(
+ belongs[,il], w_il[i])))
+ belongs[prom, (il-1)] <- w_il_1[j]
+ }
+ break
+ }
+ }
+ }
+ first_time <- FALSE
+ }
+ }
+ }
+ }
+
+ if (verbose) cat("Rgshhs: constructing SpatialPolygons ...\n")
+ holes <- !as.logical(levels %% 2)
+ nps <- sapply(polys, length)
+ IDs <- polydata$id[chosen_1[belongs[,1]]]
+ tab <- table(factor(IDs))
+ n <- length(tab)
+ IDss <- names(tab)
+ reg <- match(IDs, IDss)
+ new_belongs <- lapply(1:n, function(x) which(x == reg))
+ Srl <- vector(mode="list", length=n)
+ require("sp")
+ for (i in 1:n) {
+ nParts <- length(new_belongs[[i]])
+ srl <- NULL
+ for (j in 1:nParts) {
+ this <- new_belongs[[i]][j]
+ for (k in 1:nps[this]) {
+ crds <- polys[[this]][[k]]
+ if (!identical(crds[1,], crds[nrow(crds),])) {
+ crds <- rbind(crds, crds[1,,drop=FALSE])
+ if (verbose)
+ cat(" closing polygon", this, ":", k, "\n")
+ }
+ if (shift) crds[,1] <- ifelse(crds[,1] > 180,
+ crds[,1] - 360, crds[,1])
+ jres <- list(Polygon(crds, hole=holes[this]))
+ srl <- c(srl, jres)
+ }
+ }
+ Srl[[i]] <- Polygons(srl, ID=IDss[i])
+ }
+ res <- as.SpatialPolygons.PolygonsList(Srl,
+ proj4string=CRS("+proj=longlat +datum=WGS84"))
+ list(polydata=data.frame(polydata)[chosen_1,], belongs=belongs,
+ new_belongs=new_belongs, SP=res)
+ } else {
+ Sll <- lapply(1:length(polys), function(i) {
+ ID <- as.character(i)
+ crds <- polys[[i]][[1]]
+ if (shift) crds[,1] <- ifelse(crds[,1] > 180,
+ crds[,1] - 360, crds[,1])
+ Ln <- Line(crds)
+ Lines(list(Ln), ID=ID)
+ })
+ res <- SpatialLines(Sll,
+ proj4string=CRS("+proj=longlat +datum=WGS84"))
+ list(SP=res)
+ }
+}
diff --git a/R/SP2owin.R b/R/SP2owin.R
new file mode 100644
index 0000000..f890099
--- /dev/null
+++ b/R/SP2owin.R
@@ -0,0 +1,44 @@
+.SP2owin <- function(SP) {
+ require(spatstat)
+ pls <- slot(SP, "polygons")
+ nParts <- sapply(pls, function(x) length(slot(x, "Polygons")))
+ nOwin <- sum(nParts)
+ if (nOwin == 1) {
+ pl <- slot(pls[[1]], "Polygons")
+ crds <- slot(pl[[1]], "coords")
+ colnames(crds) <- c("x", "y")
+ rD <- pl[[1]]@ringDir
+ if (rD == 1) crds <- crds[nrow(crds):1,]
+ crds <- crds[-nrow(crds),]
+ res <- owin(poly=list(x=crds[,1], y=crds[,2]))
+ } else if (nOwin > 1) {
+ opls <- vector(mode="list", length=nOwin)
+ io <- 1
+ for (i in seq(along=pls)) {
+ pl <- slot(pls[[i]], "Polygons")
+ for (j in 1:nParts[i]) {
+ crds <- slot(pl[[j]], "coords")
+ colnames(crds) <- c("x", "y")
+ rD <- sp:::.spFindCG(crds)$rD
+ hole <- slot(pl[[j]], "hole")
+
+ if (rD == -1 && hole) crds <- crds[nrow(crds):1,]
+ else if (rD == 1 && !hole) crds <- crds[nrow(crds):1,]
+
+ crds <- crds[-nrow(crds),]
+
+ opls[[io]] <- list(x=crds[,1], y=crds[,2])
+ io <- io+1
+ }
+ }
+# if (exists(".spatstat_check") && !.spatstat_check)
+ if (!spatstat.options("checkpolygons"))
+ res <- owin(bbox(SP)[1,], bbox(SP)[2,], poly = opls,
+ check=FALSE)
+# 070718 added check avoidance
+ else res <- owin(poly=opls)
+ } else stop("no valid polygons")
+ res
+}
+
+
diff --git a/R/Spatial-methods.R b/R/Spatial-methods.R
new file mode 100644
index 0000000..9e15d1c
--- /dev/null
+++ b/R/Spatial-methods.R
@@ -0,0 +1,39 @@
+readShapeSpatial <- function(fn, proj4string=CRS(as.character(NA)),
+ verbose=FALSE, repair=FALSE, IDvar=NULL, force_ring=FALSE,
+ delete_null_obj=FALSE, retrieve_ABS_null=FALSE) {
+ shinfo <- getinfo.shape(fn)
+ if (verbose) print(shinfo)
+ type <- shinfo[[2]]
+ types <- c("Point", NA, "PolyLine", NA, "Polygon", NA, NA,
+ "MultiPoint", NA, NA, "PointZ", NA, "PolyLineZ", NA,
+ "PolygonZ", NA, NA, "MultiPointZ", NA, NA, "PointM", NA,
+ "PolyLineM", NA, "PolygonM", NA, NA, "MultiPointM", NA, NA,
+ "MultiPatch")
+ typeSh <- types[type]
+ if (typeSh == "Point" || typeSh == "PointZ" || typeSh == "MultiPoint") {
+ res <- readShapePoints(fn=fn, proj4string=proj4string,
+ verbose=verbose, repair=repair)
+ } else if (typeSh == "PolyLine" || typeSh == "PolyLineZ") {
+ res <- readShapeLines(fn=fn, proj4string=proj4string,
+ verbose=verbose, repair=repair)
+ } else if (typeSh == "Polygon" || typeSh == "PolygonZ") {
+ res <- readShapePoly(fn=fn, IDvar=IDvar, proj4string=proj4string,
+ verbose=verbose, repair=repair, force_ring=force_ring,
+ delete_null_obj=delete_null_obj,
+ retrieve_ABS_null=retrieve_ABS_null)
+ } else stop("File type cannot be read")
+ res
+}
+
+writeSpatialShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
+ if (is(x, "SpatialPolygonsDataFrame")) {
+ writePolyShape(x=x, fn=fn, factor2char=factor2char,
+ max_nchar=max_nchar)
+ } else if (is(x, "SpatialLinesDataFrame")) {
+ writeLinesShape(x=x, fn=fn, factor2char=factor2char,
+ max_nchar=max_nchar)
+ } else if (is(x, "SpatialPointsDataFrame")) {
+ writePointsShape(x=x, fn=fn, factor2char=factor2char,
+ max_nchar=max_nchar)
+ }
+}
diff --git a/R/SpatialLines-methods.R b/R/SpatialLines-methods.R
new file mode 100644
index 0000000..6c5b765
--- /dev/null
+++ b/R/SpatialLines-methods.R
@@ -0,0 +1,86 @@
+readShapeLines <- function(fn, proj4string=CRS(as.character(NA)),
+ verbose=FALSE, repair=FALSE) {
+ suppressWarnings(Map <- read.shape(filen=fn, verbose=verbose,
+ repair=repair))
+ suppressWarnings(.shp2LinesDF(Map, proj4string=proj4string))
+}
+
+writeLinesShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
+ df <- as(x, "data.frame")
+ df <- data.frame(SL_ID=I(row.names(df)), df)
+ pls <- .SpL2lineslist(as(x, "SpatialLines"))
+ suppressWarnings(write.linelistShape(pls, df, file=fn,
+ factor2char = factor2char, max_nchar=max_nchar))
+}
+
+
+.shp2LinesDF <- function(shp, proj4string=CRS(as.character(NA)), IDs) {
+ if (class(shp) != "Map") stop("shp not a Map object")
+ shp.type <- attr(shp$Shapes, "shp.type")
+ if (!shp.type %in% c("arc", "poly"))
+ stop("not an arc or poly Map object")
+ df <- shp$att.data
+ shapes <- shp$Shapes
+ n <- length(shapes)
+ LinesList <- vector(mode="list", length=n)
+ if (missing(IDs)) IDs <- as.character(sapply(shapes,
+ function(x) x$shpID))
+ if (length(IDs) != n) stop("IDs length differs from number of lines")
+ row.names(df) <- IDs
+ for (i in 1:n) {
+ LinesList[[i]] <- .shapes2LinesList(shapes[[i]], ID=IDs[i])
+ }
+ SL <- SpatialLines(LinesList, proj4string=proj4string)
+ res <- SpatialLinesDataFrame(SL, data=df)
+ res
+}
+
+.shapes2LinesList <- function(shape, ID) {
+ nParts <- attr(shape, "nParts")
+ Pstart <- shape$Pstart
+ nVerts <- nrow(shape$verts)
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ for (j in 1:nParts) {
+ if (j == nParts) to[j] <- nVerts
+ else {
+ to[j] <- Pstart[j+1]
+ from[j+1] <- to[j]+1
+ }
+ }
+ res <- vector(mode="list", length=nParts)
+ for (i in 1:nParts) {
+ res[[i]] <- Line(coords=shape$verts[from[i]:to[i],])
+ }
+ Lines <- Lines(res, ID=ID)
+ Lines
+}
+
+.SpL2lineslist <- function(x) {
+ pls <- slot(x, "lines")
+ n <- length(pls)
+ res <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ xyL <- lapply(slot(pls[[i]], "Lines"),
+ coordinates)
+ nP <- length(xyL)
+ nVs <- sapply(xyL, nrow)
+ res[[i]] <- .xyList2NAmat(xyL)
+ attr(res[[i]], "nParts") <- as.integer(nP)
+ from <- integer(nP)
+ to <- integer(nP)
+ from[1] <- 1
+ to[1] <- nVs[1]
+ if (nP > 1) for (j in 2:nP) {
+ from[j] <- to[(j-1)] + 2
+ to[j] <- from[j] + nVs[j] - 1
+ }
+ attr(res[[i]], "pstart") <- list(from=as.integer(from),
+ to=as.integer(to))
+ }
+ class(res) <- "lineslist"
+ invisible(res)
+}
+
+
diff --git a/R/SpatialPoints-methods.R b/R/SpatialPoints-methods.R
new file mode 100644
index 0000000..355b2f9
--- /dev/null
+++ b/R/SpatialPoints-methods.R
@@ -0,0 +1,31 @@
+readShapePoints <- function(fn, proj4string=CRS(as.character(NA)),
+ verbose=FALSE, repair=FALSE) {
+ suppressWarnings(Map <- read.shape(filen=fn, verbose=verbose,
+ repair=repair))
+ suppressWarnings(.Map2SPDF(Map, proj4string=proj4string))
+}
+
+.Map2SPDF <- function(Map, IDs, proj4string=CRS(as.character(NA))) {
+ if (missing(IDs))
+ IDs <- as.character(sapply(Map$Shapes, function(x) x$shpID))
+ coords <- Map2points(Map)
+ oldClass(coords) <- NULL
+ rownames(coords) <- IDs
+ attr(coords, "shpID") <- NULL
+ attr(coords, "maplim") <- NULL
+
+ df <- Map$att.data
+ rownames(df) <- IDs
+ res <- SpatialPointsDataFrame(coords=coords, data=df,
+ proj4string=proj4string, match.ID=TRUE)
+ res
+}
+
+writePointsShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
+ df <- as(x, "data.frame")
+ coords <- coordinates(x)
+ suppressWarnings(write.pointShape(coordinates=coords, df=df, file=fn,
+ factor2char = factor2char, max_nchar=max_nchar))
+}
+
+
diff --git a/R/SpatialPolys-methods.R b/R/SpatialPolys-methods.R
new file mode 100644
index 0000000..5190b02
--- /dev/null
+++ b/R/SpatialPolys-methods.R
@@ -0,0 +1,221 @@
+readShapePoly <- function(fn, IDvar=NULL, proj4string=CRS(as.character(NA)),
+ verbose=FALSE, repair=FALSE, force_ring=FALSE, delete_null_obj=FALSE,
+ retrieve_ABS_null=FALSE) {
+ suppressWarnings(Map <- read.shape(filen=fn,
+ verbose=verbose, repair=repair))
+ if (!is.null(IDvar)) {
+ IDvar <- as.character(IDvar)
+ if (!IDvar %in% names(Map$att.data))
+ stop(paste("column not found:", IDvar))
+ IDvar <- as.character(Map$att.data[[IDvar]])
+ }
+ .Map2PolyDF(Map, IDs=IDvar, proj4string=proj4string,
+ force_ring=force_ring, delete_null_obj=delete_null_obj,
+ retrieve_ABS_null=retrieve_ABS_null)
+}
+
+writePolyShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
+ stopifnot(class(x) == "SpatialPolygonsDataFrame")
+ df <- as(x, "data.frame")
+ df <- data.frame(SP_ID=I(row.names(df)), df)
+ pls <- .SpP2polylist(as(x, "SpatialPolygons"))
+ suppressWarnings(write.polylistShape(pls, df, file=fn,
+ factor2char = factor2char, max_nchar=max_nchar))
+}
+
+.Map2PolyDF <- function(Map, IDs, proj4string=CRS(as.character(NA)),
+ force_ring=FALSE, delete_null_obj=FALSE, retrieve_ABS_null=FALSE) {
+# ABS null part shapefiles Graham Williams 080403
+ if (delete_null_obj) {
+ nullParts <- which(sapply(Map$Shapes, function(x) x$nParts) == 0)
+ if (length(nullParts) > 0) {
+ if (!retrieve_ABS_null) {
+ for (i in length(nullParts):1)
+ Map$Shapes[[nullParts[i]]] <- NULL
+ attr(Map$Shapes,'nshps') <- attr(Map$Shapes,'nshps') -
+ length(nullParts)
+ Map$att.data <- Map$att.data[-nullParts,]
+ warning(paste("Null objects with the following",
+ "indices deleted:", paste(nullParts, collapse=", ")))
+ } else {
+ res <- Map$att.data[nullParts,]
+ return(res)
+ }
+ }
+ }
+ if (is.null(IDs))
+ IDs <- as.character(sapply(Map$Shapes, function(x) x$shpID))
+ SR <- .asSpatialPolygonsShapes(Map$Shapes, IDs,
+ proj4string=proj4string, force_ring=force_ring)
+ df <- Map$att.data
+ rownames(df) <- IDs
+ res <- SpatialPolygonsDataFrame(Sr=SR, data=df)
+ res
+}
+
+.asSpatialPolygonsShapes <- function(shapes, IDs,
+ proj4string=CRS(as.character(NA)), force_ring=FALSE) {
+ if (attr(shapes, "shp.type") != "poly")
+ stop("Not polygon shapes")
+ if (missing(IDs))
+ IDs <- as.character(sapply(shapes, function(x) x$shpID))
+ if (length(IDs) != attr(shapes,'nshps'))
+ stop("Number of shapes and IDs differ")
+ tab <- table(factor(IDs))
+ n <- length(tab)
+ IDss <- .mixedsort(names(tab))
+# try to preserve sensible ordering
+# IDss <- names(tab)
+ reg <- match(IDs, IDss)
+ belongs <- lapply(1:n, function(x) which(x == reg))
+# assemble the list of Srings
+ Srl <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ nParts <- length(belongs[[i]])
+ srl <- NULL
+ for (j in 1:nParts) {
+ jres <- .shp2srsI(shapes[[belongs[[i]][j]]],
+ .nParts.shpI(shapes[[belongs[[i]][j]]]),
+ force_ring=force_ring)
+ srl <- c(srl, jres)
+ }
+ Srl[[i]] <- Polygons(srl, ID=IDss[i])
+ }
+ res <- as.SpatialPolygons.PolygonsList(Srl, proj4string=proj4string)
+ res
+}
+# Function mixedorder copied from gtools 2.2.3 LGPL Gregory R. Warnes
+.mixedsort <- function (x) {
+ x[.mixedorder(x)]
+}
+
+.mixedorder <- function (x) {
+ delim = "\\$\\@\\$"
+ numeric <- function(x) {
+ optwarn = options("warn")
+ on.exit(options(optwarn))
+ options(warn = -1)
+ as.numeric(x)
+ }
+ nonnumeric <- function(x) {
+ optwarn = options("warn")
+ on.exit(options(optwarn))
+ options(warn = -1)
+ ifelse(is.na(as.numeric(x)), toupper(x), NA)
+ }
+ x <- as.character(x)
+ which.nas <- which(is.na(x))
+ which.blanks <- which(x == "")
+ if (length(which.blanks) > 0)
+ x[which.blanks] <- -Inf
+ if (length(which.nas) > 0)
+ x[which.nas] <- Inf
+ delimited <- gsub("([+-]{0,1}[0-9.]+([eE][+-]{0,1}[0-9.]+){0,1})",
+ paste(delim, "\\1", delim, sep = ""), x)
+ step1 <- strsplit(delimited, delim)
+ step1 <- lapply(step1, function(x) x[x > ""])
+ step1.numeric <- lapply(step1, numeric)
+ step1.character <- lapply(step1, nonnumeric)
+ maxelem <- max(sapply(step1, length))
+ step1.numeric.t <- lapply(1:maxelem, function(i) sapply(step1.numeric,
+ function(x) x[i]))
+ step1.character.t <- lapply(1:maxelem, function(i) sapply(step1.character,
+ function(x) x[i]))
+ rank.numeric <- sapply(step1.numeric.t, rank)
+ rank.character <- sapply(step1.character.t,
+ function(x) as.numeric(factor(x)))
+ rank.numeric[!is.na(rank.character)] <- 0
+ rank.character <- t(t(rank.character) + apply(matrix(rank.numeric),
+ 2, max, na.rm = TRUE))
+ rank.overall <- ifelse(is.na(rank.character), rank.numeric,
+ rank.character)
+ order.frame <- as.data.frame(rank.overall)
+ if (length(which.nas) > 0)
+ order.frame[which.nas, ] <- Inf
+ retval <- do.call("order", order.frame)
+ return(retval)
+}
+
+.shp2srsI <- function(shp, nParts, force_ring=FALSE) {
+ Pstart <- shp$Pstart
+ nVerts <- nrow(shp$verts)
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ for (j in 1:nParts) {
+ if (j == nParts) to[j] <- nVerts
+ else {
+ to[j] <- Pstart[j+1]
+ from[j+1] <- to[j]+1
+ }
+ }
+ srl <- vector(mode="list", length=nParts)
+ for (j in 1:nParts) {
+ crds <- shp$verts[from[j]:to[j],]
+ if (force_ring) {
+ if (!isTRUE(all.equal(crds[1,], crds[nrow(crds),])))
+ crds <- rbind(crds, crds[1,])
+ }
+ srl[[j]] <- Polygon(coords=crds)
+ }
+ srl
+}
+
+.nParts.shpI <- function(shp) attr(shp, "nParts")
+
+.xyList2NAmat <- function(xyList) {
+ nParts <- length(xyList)
+ res <- xyList[[1]]
+ if (nParts > 1) {
+ for(i in 2:nParts)
+ res <- rbind(res, c(NA,NA), xyList[[i]])
+ }
+ res
+}
+
+.SpP2polylist <- function(x) {
+ pls <- slot(x, "polygons")
+ n <- length(pls)
+ res <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ xyL <- lapply(slot(pls[[i]], "Polygons"),
+ function(i) slot(i, "coords"))
+ nP <- length(xyL)
+ nVs <- sapply(xyL, nrow)
+ res[[i]] <- .xyList2NAmat(xyL)
+ attr(res[[i]], "nParts") <- as.integer(nP)
+ from <- integer(nP)
+ to <- integer(nP)
+ from[1] <- 1
+ to[1] <- nVs[1]
+ if (nP > 1) for (j in 2:nP) {
+ from[j] <- to[(j-1)] + 2
+ to[j] <- from[j] + nVs[j] - 1
+ }
+ attr(res[[i]], "pstart") <- list(from=as.integer(from),
+ to=as.integer(to))
+ attr(res[[i]], "bbox") <- c(bbox(pls[[i]]))
+ }
+ attr(res, "region.id") <- sapply(pls, function(i) slot(i, "ID"))
+ class(res) <- "polylist"
+ invisible(res)
+}
+
+.polylist2SpP <- function(pl) {
+ if (!inherits(pl, "polylist")) stop("not a polylist object")
+ n <- length(pl)
+ IDs <- attr(pl, "region.id")
+ pL <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ nP <- attr(pl[[i]], "nParts")
+ Ps <- vector(mode="list", length=nP)
+ from <- attr(pl[[i]], "pstart")$from
+ to <- attr(pl[[i]], "pstart")$to
+ for (j in 1:nP) {
+ Ps[[j]] <- Polygon(pl[[i]][from[j]:to[j],])
+ }
+ pL[[i]] <- Polygons(Ps, IDs[i])
+ }
+ res <- SpatialPolygons(pL)
+ res
+}
diff --git a/R/asciigrid.R b/R/asciigrid.R
new file mode 100644
index 0000000..1041fb5
--- /dev/null
+++ b/R/asciigrid.R
@@ -0,0 +1,101 @@
+readAsciiGrid <- function(fname, as.image = FALSE, plot.image = FALSE,
+ colname=basename(fname), proj4string = CRS(as.character(NA)),
+ dec=options()$OutDec) {
+# if (dec == ".") pdec = "\\."
+ pdec <- paste("\\", dec, sep="")
+ t = file(fname, "r")
+ l5 = readLines(t, n = 6)
+ # instead of:
+ # l5s = strsplit(l5, " ")
+ # Michael Summer, mdsumner at utas.edu.au suggested:
+ l5s = strsplit(l5, "\\s+", perl = T)
+ xllcenter = yllcenter = xllcorner = yllcorner = as.numeric(NA)
+ for (i in 1:6) {
+ fieldname = casefold(l5s[[i]][1])
+ if (length(grep("ncols", fieldname)))
+ ncols = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("nrows", fieldname)))
+ nrows = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("xllcorner", fieldname)))
+ xllcorner = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("yllcorner", fieldname)))
+ yllcorner = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("xllcenter", fieldname)))
+ xllcenter = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("yllcenter", fieldname)))
+ yllcenter = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("cellsize", fieldname)))
+ cellsize = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ if (length(grep("nodata_value", fieldname)))
+ nodata.value = as.numeric(sub(pdec, ".", l5s[[i]][2]))
+ }
+ if (is.na(xllcorner) && !is.na(xllcenter))
+ xllcorner = xllcenter - 0.5 * cellsize
+ else
+ xllcenter = xllcorner + 0.5 * cellsize
+ if (is.na(yllcorner) && !is.na(yllcenter))
+ yllcorner = yllcenter - 0.5 * cellsize
+ else
+ yllcenter = yllcorner + 0.5 * cellsize
+ map = scan(t, as.numeric(0), quiet = TRUE, dec=dec)
+ close(t)
+ if (length(as.vector(map)) != nrows * ncols)
+ stop("dimensions of map do not match that of header")
+ map[map == nodata.value] = NA
+ if (as.image) {
+ img = matrix(map, ncols, nrows)[,nrows:1]
+ img = list(z = img, x = xllcorner + cellsize * ((1:ncols) - 0.5),
+ y = yllcorner + cellsize * ((1:nrows) - 0.5))
+ if (plot.image) {
+ image(img, asp = 1)
+ return(invisible(img))
+ } else
+ return(img)
+ }
+ df = data.frame(map)
+ names(df) = colname
+ grid = GridTopology(c(xllcenter,yllcenter), rep(cellsize,2), c(ncols,nrows))
+ SpatialGridDataFrame(grid, data = df, proj4string=proj4string)
+}
+
+writeAsciiGrid <- function(x, fname, attr = 1, na.value = -9999,
+ dec=options()$OutDec, ...) {
+
+# R> gridparameters(meuse.grid)
+# cellcentre.offset cellsize cells.dim
+# x 178460 40 78
+# y 329620 40 104
+
+#NCOLS 80
+#NROWS 115
+#XLLCORNER 178400.000000
+#YLLCORNER 329400.000000
+#CELLSIZE 40.000000
+#NODATA_VALUE 1e31
+# if (dec == ".") dec = "\\."
+ if (!gridded(x))
+ stop("can only write SpatialGridDataFrame objects to asciigrid")
+ x = as(x, "SpatialGridDataFrame")
+ gp = gridparameters(x)
+ if (length(gp$cells.dim) != 2)
+ stop("asciigrid only supports 2D grids")
+# if (gp$cellsize[1] != gp$cellsize[2])
+ if (diff(gp$cellsize) < .Machine$double.eps ^ 0.5)
+ gp$cellsize <- rep(mean(gp$cellsize), 2)
+ else
+ stop("Asciigrid does not support grids with non-square cells")
+ f = file(fname, open = "w")
+ writeLines(c(paste("NCOLS", format(gp$cells.dim[1], decimal.mark=dec)),
+ paste("NROWS", format(gp$cells.dim[2], decimal.mark=dec)),
+ paste("XLLCORNER", format(gp$cellcentre.offset[1] -
+ 0.5 * gp$cellsize[1], decimal.mark=dec)),
+ paste("YLLCORNER", format(gp$cellcentre.offset[2] -
+ 0.5 * gp$cellsize[2], decimal.mark=dec)),
+ paste("CELLSIZE", format(gp$cellsize[1], decimal.mark=dec)),
+ paste("NODATA_VALUE", format(na.value, decimal.mark=dec))), f)
+ z = x at data[[attr]]
+ z[is.na(z)] = na.value
+ write.table(t(matrix(z, gp$cells.dim[1], gp$cells.dim[2])), file = f,
+ row.names = FALSE, col.names = FALSE, dec=dec, ...)
+ close(f)
+}
diff --git a/R/azimuth.R b/R/azimuth.R
new file mode 100644
index 0000000..906f592
--- /dev/null
+++ b/R/azimuth.R
@@ -0,0 +1,52 @@
+# Copyright (c) 2006 Roger Bivand
+qibla <- function(from, type="abdali") {
+# Mecca as given by K. Abdali
+ to <- c(39.82333, 21.42333)
+ gzAzimuth(from=from, to=to, type=type)
+}
+# http://www.geocities.com/sualeh85/sfweb/QTable.html
+# http://patriot.net/users/abdali/ftp/qibla.pdf
+# http://www.patriot.net/users/abdali/ftp/praytimer.zip
+# http://www.world-gazetteer.com/
+
+gzAzimuth <- function(from, to, type="snyder_sphere") {
+ deg2rad <- function(x) x*pi/180
+ rad2deg <- function(x) x*180/pi
+# note negative longitudes
+ if (is.matrix(from)) {
+ lon <- -deg2rad(from[,1])
+ lat <- deg2rad(from[,2])
+ } else {
+ lon <- -deg2rad(from[1])
+ lat <- deg2rad(from[2])
+ }
+ if (is.matrix(to)) {
+ if (nrow(to) > 1) stop("to: single coordinate")
+ to <- c(to)
+ }
+ lon0 <- -deg2rad(to[1])
+ lat0 <- deg2rad(to[2])
+# bug found by Sebastian Luque
+ dflon = lon-lon0
+# results in degrees from N, negative west
+ if (type == "abdali") res <- atan2(sin(dflon), ((cos(lat)*tan(lat0)) -
+ (sin(lat)*cos(dflon))))
+ else if (type == "snyder_sphere") res <- atan2((cos(lat0)*sin(dflon)),
+ (cos(lat)*sin(lat0)) - (sin(lat)*cos(lat0)*cos(dflon)))
+ else stop("type unkown")
+ is.na(res) <- lon == lon0 & lat == lat0
+ rad2deg(res)
+}
+
+trackAzimuth <- function(track, type="snyder_sphere") {
+ if (!is.matrix(track)) stop("track must be two-column matrix")
+ if (ncol(track) != 2) stop("track must be two-column matrix")
+ n1 <- nrow(track)-1
+ if (n1 < 2) stop("less than two points")
+ res <- numeric(n1)
+ for (i in seq(along=res)) res[i] <- gzAzimuth(track[i,], track[(i+1),],
+ type=type)
+ res
+}
+
+
diff --git a/R/checkHoles.R b/R/checkHoles.R
new file mode 100644
index 0000000..7f129f1
--- /dev/null
+++ b/R/checkHoles.R
@@ -0,0 +1,72 @@
+checkPolygonsHoles <- function(x) {
+ require(gpclib)
+ if (!is(x, "Polygons")) stop("not an Polygons object")
+ pls <- slot(x, "Polygons")
+ nParts <- length(pls)
+# proj4CRS <- CRS(proj4string(x))
+ ID <- slot(x, "ID")
+ gpc <- as(slot(pls[[1]], "coords"), "gpc.poly")
+ if (nParts > 1) for (i in 2:nParts) gpc <- append.poly(gpc,
+ as(slot(pls[[i]], "coords"), "gpc.poly"))
+ bb <- get.bbox(gpc)
+ bbmat <- matrix(c(rep(bb$x[1], 2), rep(bb$x[2], 2), bb$x[1], bb$y[1],
+ rep(bb$y[2], 2), rep(bb$y[1], 2)), ncol=2)
+ gpc_bb <- as(bbmat, "gpc.poly")
+ gpc_res <- gpclib:::intersect(gpc, gpc_bb)
+ nP <- length(gpc_res at pts)
+ Srl <- vector(mode="list", length=nP)
+ for (j in 1:nP) {
+ crds <- cbind(gpc_res at pts[[j]]$x, gpc_res at pts[[j]]$y)
+ crds <- rbind(crds, crds[1,])
+ hole <- gpc_res at pts[[j]]$hole
+ rD <- .ringDirxy_gpc(crds)
+ if (rD == 1 & hole) crds <- crds[nrow(crds):1,]
+ if (rD == -1 & !hole) crds <- crds[nrow(crds):1,]
+ Srl[[j]] <- Polygon(coords=crds,
+#proj4string=proj4CRS,
+hole=hole)
+ }
+ res <- Polygons(Srl, ID=ID)
+ res
+}
+
+.ringDirxy_gpc <- function(xy) {
+ a <- xy[,1]
+ b <- xy[,2]
+ nvx <- length(b)
+
+ if((a[1] == a[nvx]) && (b[1] == b[nvx])) {
+ a <- a[-nvx]
+ b <- b[-nvx]
+ nvx <- nvx - 1
+ }
+ if (nvx < 3) return(1)
+
+ tX <- 0.0
+ dfYMax <- max(b)
+ ti <- 1
+ for (i in 1:nvx) {
+ if (b[i] == dfYMax && a[i] > tX) ti <- i
+ }
+ if ( (ti > 1) & (ti < nvx) ) {
+ dx0 = a[ti-1] - a[ti]
+ dx1 = a[ti+1] - a[ti]
+ dy0 = b[ti-1] - b[ti]
+ dy1 = b[ti+1] - b[ti]
+ } else if (ti == nvx) {
+ dx0 = a[ti-1] - a[ti]
+ dx1 = a[1] - a[ti]
+ dy0 = b[ti-1] - b[ti]
+ dy1 = b[1] - b[ti]
+ } else {
+# /* if the tested vertex is at the origin then continue from 0 (1) */
+ dx1 = a[2] - a[1]
+ dx0 = a[nvx] - a[1]
+ dy1 = b[2] - b[1]
+ dy0 = b[nvx] - b[1]
+ }
+ v3 = ( (dx0 * dy1) - (dx1 * dy0) )
+ if ( v3 > 0 ) return(as.integer(1))
+ else return(as.integer(-1))
+}
+
diff --git a/R/colslegs.R b/R/colslegs.R
new file mode 100644
index 0000000..e96d059
--- /dev/null
+++ b/R/colslegs.R
@@ -0,0 +1,72 @@
+# Copyright 2000-2001 (c) Nicholas Lewin-Koh
+# modifications 2001-2003 (c) Roger Bivand
+
+
+# Returns a vector of HSV values
+# modifications 2003 (c) Renaud Lancelot
+color.ramp <- function (nclass, color = "red", nvec = NULL, type = "q"){
+ eq.split <- function(ncl){
+ mult <- rep((1 / ncl), (ncl - 1))
+ mult * seq(1, (ncl - 1))
+ }
+ color.list <- list(cname = c("blue", "green", "yellow", "red"), hsvcol = c(0.7, 0.375, 0.19, 0))
+ cind <- match(color, color.list$cname)
+### change from "if(nvec)" to "if(!is.null(nvec))"
+ if(!is.null(nvec)){
+ if(type == "q"){
+ pr <- eq.split(nclass)
+### changes in min, quantile and max
+ brks <- c(min(nvec, na.rm = TRUE),
+ quantile(nvec, pr, names = FALSE, na.rm = TRUE),
+ max(nvec, na.rm = TRUE))
+ brks <- unique(brks)
+ classvec <- cut(nvec, brks, labels = FALSE, include.lowest = TRUE)
+ ramp <- hsv(rep(color.list$hsvcol[cind], nclass), c(pr, 1))
+ return(list(ramp = ramp, col.class = classvec, breaks=brks))
+ }
+ else
+ if(type == "e"){
+ pr <- eq.split(nclass)
+### changes in min, range and max
+ brks <- c(min(nvec, na.rm = TRUE),
+ pr * diff(range(nvec, na.rm = TRUE)),
+ max(nvec, na.rm = TRUE))
+ brks <- unique(brks)
+ classvec <- cut(nvec, brks, labels = FALSE, include.lowest = TRUE)
+ ramp <- hsv(rep(color.list$hsvcol[cind], nclass), c(pr, 1))
+ return(list(ramp = ramp, col.class = classvec, breaks=brks))
+ }
+ }
+ return(NULL)
+}
+
+leglabs <- function(vec, under="under", over="over", between="-") {
+ x <- vec
+ lx <- length(x)
+ if(lx < 3) stop("vector too short")
+ res <- character(lx-1)
+ res[1] <- paste(under, x[2])
+ for (i in 2:(lx-2)) res[i] <- paste(x[i], between, x[i+1])
+ res[lx-1] <- paste(over, x[lx-1])
+ res
+}
+
+#The set of classification methods is large (Dent p. 145), but there are a few to remember:
+
+# * Equal Intervals ("Constant Interval"): each class has same difference in value
+# * Quantile (N-tile): each class has same number of units
+# * Natural Breaks: visual examination; manual determination
+
+# Then a lot of ones that you might need to use once in a while
+ # Arithmetic progression: constant increase (decrease) in "width" of class
+ # Geometric progression: constant multiplier used to derive width of class
+ # Jenk's Iterative ("optimal") minimize within class standard deviations (variance) [ESRI calls this "natural breaks"]
+# (see Dent 147-149 on use of F-ratio and weighting)
+ # Arbitrary breaks: given externally (laws, regulations, natural process)
+ # Standard deviations: statistical distribution
+ # Nested Means works by successive halving at the mean (2,4,8,16, ...)
+
+#(Chrisman)
+
+
+
diff --git a/R/dotsinpolys.R b/R/dotsinpolys.R
new file mode 100644
index 0000000..4a8a7b7
--- /dev/null
+++ b/R/dotsinpolys.R
@@ -0,0 +1,106 @@
+# Copyright 2004-5 (c) Roger Bivand
+
+dotsInPolys <- function(pl, x, f="random", offset, compatible=FALSE) {
+ if (!is.character(f)) stop("f must be a character string")
+ if (f != "random" && f != "regular") stop(paste(f, "not supported"))
+ if (inherits(pl, "polylist")) pl <- .polylist2SpP(pl)
+ if (!is(pl, "SpatialPolygons")) stop("unknown class of input polygons")
+ pls <- slot(pl, "polygons")
+ IDs <- sapply(pls, function(i) slot(i, "ID"))
+ if (length(pls) != length(x)) stop("different lengths")
+ if (!inherits(x, "integer")) {
+ x <- as.integer(x)
+ warning("x coerced to integer")
+ }
+ n <- length(pls)
+ if (n < 1) stop("zero Polygons")
+ res <- vector(mode="list", length=n)
+ ID_out <- NULL
+ if (missing(offset)) {
+ if (f == "random") offset <- runif(2)
+ else offset <- c(0.5,0.5)
+ }
+ for (i in 1:n) {
+ if (x[i] > 0) {
+ ires <- sample.Polygons(pls[[i]], x[i], type=f, offset=offset)
+ if (!is.null(ires)) res[[i]] <- ires
+ if (!is.null(res[[i]])) ID_out <- c(ID_out, IDs[i])
+ }
+ }
+ if (!compatible) {
+ resa <- do.call("rbind", lapply(res, function(x)
+ if (!is.null(x)) coordinates(x)))
+ reps <- unlist(sapply(res, function(x)
+ if (!is.null(x)) nrow(coordinates(x))))
+ res <- data.frame(resa, rep(ID_out, reps))
+ names(res) <- c("x", "y", "ID")
+ coordinates(res) <- c("x", "y")
+ } else {
+ j <- 1
+ for (i in 1:n) {
+ if (!is.null(res[[i]])) {
+ res[[i]] <- coordinates(res[[i]])
+ attr(res[[i]], "ID") <- ID_out[j]
+ j <- j+1
+ }
+ }
+ }
+ res
+}
+
+symbolsInPolys <- function(pl, dens, symb="+", compatible=FALSE) {
+ if (inherits(pl, "polylist")) pl <- .polylist2SpP(pl)
+ if (!is(pl, "SpatialPolygons")) stop("unknown class of input polygons")
+ if (!is(pl, "SpatialPolygons")) stop("unknown class of input polygons")
+ pls <- slot(pl, "polygons")
+ n <- length(pls)
+ if (n < 1) stop("zero Polygons")
+ if (n != length(dens)) dens <- rep(dens[1], n)
+ if (n != length(symb)) symb <- rep(symb[1], n)
+ areas <- lapply(pls, function(x) sapply(slot(x, "Polygons"),
+ function(i) slot(i, "area")))
+ holes <- lapply(pls, function(x) sapply(slot(x, "Polygons"),
+ function(i) slot(i, "hole")))
+ counts <- vector(mode="list", n)
+ for (i in 1:n) {
+ cntvec <- NULL
+ for (j in 1:length(areas[[i]])) {
+ cntvec[j] <- ifelse(holes[[i]][j], 0, areas[[i]][j] * dens[i])
+ }
+ counts[[i]] <- as.integer(cntvec)
+ }
+
+ res <- vector(mode="list", n)
+ symb_out <- NULL
+ for (i in 1:n) {
+ px <- as.integer(sum(counts[[i]]))
+ if (px > 0) {
+ ires <- sample.Polygons(pls[[i]], px, type="regular",
+ offset=c(0.5,0.5))
+ if (!is.null(ires)) res[[i]] <- ires
+ if (!is.null(res[[i]])) symb_out <- c(symb_out, symb[i])
+ }
+ }
+
+ if (!compatible) {
+ resa <- do.call("rbind", lapply(res, function(x)
+ if(!is.null(x)) coordinates(x)))
+ reps <- unlist(sapply(res, function(x)
+ if(!is.null(x)) nrow(coordinates(x))))
+ res <- data.frame(resa, rep(symb_out, reps))
+ names(res) <- c("x", "y", "symb")
+ coordinates(res) <- c("x", "y")
+ } else {
+ j <- 1
+ for (i in 1:n) {
+ if (!is.null(res[[i]])) {
+ res[[i]] <- coordinates(res[[i]])
+ attr(res[[i]], "symb") <- symb_out[j]
+ j <- j+1
+ }
+ }
+ }
+ res
+}
+
+
diff --git a/R/elide.R b/R/elide.R
new file mode 100755
index 0000000..eaeb3fc
--- /dev/null
+++ b/R/elide.R
@@ -0,0 +1,216 @@
+## 11/21/07 dhm
+## version where shift works for lines and polygons
+## adding option to rotate
+
+if (!isGeneric("elide")) {
+ setGeneric("elide", function(obj, ...) {
+ standardGeneric("elide")
+ })
+}
+
+elide.points <- function(obj, bb=NULL, shift=c(0, 0), reflect=c(FALSE, FALSE),
+ scale=NULL, flip=FALSE, rotate=0, center=NULL, unitsq=FALSE) {
+ if (length(shift) != 2)
+ stop("Two coordinate shift in input units required")
+ if (!is.numeric(shift)) stop("shift not numeric")
+ if (!is.logical(reflect)) stop("reflect must be logical")
+ if (length(reflect) != 2) stop("Two coordinate reflect required")
+ if (!is.logical(flip)) stop("flip must be logical")
+ if (!is.numeric(rotate)) stop("rotate not numeric")
+ if (!is.null(center) && length(center) != 2)
+ stop("center must be numeric of length two")
+ if (!is.logical(unitsq)) stop("unitsq must be logical")
+ crds <- coordinates(obj)
+ if (is.null(bb)) bb <- bbox(obj)
+ if (rotate != 0 && is.null(center)) center <- bb[,1]
+ if (rotate != 0) crds <- rotateCoords(crds, rotate, center)
+ if (flip) {
+ y <- crds[,1] + shift[1]
+ x <- crds[,2] + shift[2]
+ yr <- bb[1,] + shift[1]
+ xr <- bb[2,] + shift[2]
+ } else {
+ x <- crds[,1] + shift[1]
+ y <- crds[,2] + shift[2]
+ xr <- bb[1,] + shift[1]
+ yr <- bb[2,] + shift[2]
+ }
+ bb <- NULL
+ if (!is.null(scale) && is.logical(scale) && scale && unitsq) {
+ bb <- rbind(c(0,1), c(0,1))
+ colnames(bb) <- c("min", "max")
+ }
+ scale <- scaleCoords(scale=scale, xr=xr, yr=yr)
+ crds <- elideCoords(x=x, y=y, xr=xr, yr=yr, reflect=reflect, scale=scale)
+ res <- SpatialPoints(crds, bbox=bb)
+ res
+}
+
+elide.pointsdf <- function(obj, bb=NULL, shift=c(0, 0),
+ reflect=c(FALSE, FALSE), scale=NULL, flip=FALSE, rotate=0, center=NULL) {
+ res <- elide(as(obj, "SpatialPoints"), bb=bb, shift=shift,
+ reflect=reflect, scale=scale, flip=flip, rotate=rotate, center=center)
+# df <- as(obj, "data.frame")[,-c(1,2)]
+# df <- as(obj, "data.frame")
+ df <- slot(obj, "data")
+ res <- SpatialPointsDataFrame(res, data=df)
+ res
+}
+
+setMethod("elide", signature(obj="SpatialPoints"), elide.points)
+
+setMethod("elide", signature(obj="SpatialPointsDataFrame"), elide.pointsdf)
+
+## rotate angle degrees clockwise around center
+rotateCoords <- function(crds, angle=0, center= c(min(crds[,1]),min(crds[,2]))) {
+ co <- cos(-angle*pi/180)
+ si <- sin(-angle*pi/180)
+ adj <- matrix(rep(center,nrow(crds)),ncol=2,byrow=TRUE)
+ crds <- crds-adj
+ cbind(co * crds[,1] - si * crds[,2],
+ si * crds[,1] + co * crds[,2]) + adj
+}
+
+scaleCoords <- function(scale, xr, yr) {
+ if (!is.null(scale)) {
+ if (is.logical(scale) && scale) scale <- 1
+ else if (!is.numeric(scale)) stop("scale neither TRUE nor numeric")
+ dx <- abs(diff(xr))
+ dy <- abs(diff(yr))
+ md <- max(dx, dy)
+ scale <- scale * (1/md)
+ } else scale <- 1
+ scale
+}
+
+elideCoords <- function(x, y, xr, yr, reflect, scale, rotate, center) {
+ if (reflect[1]) {
+ x <- xr[2] - x + xr[1]
+ }
+ if (reflect[2]) {
+ y <- yr[2] - y + yr[1]
+ }
+ if (!isTRUE(all.equal(scale, 1))) {
+ x <- (x - xr[1]) * scale
+ y <- (y - yr[1]) * scale
+ }
+ crds <- cbind(x, y)
+ crds
+}
+
+elide.lines <- function(obj, bb=NULL, shift=c(0, 0), reflect=c(FALSE, FALSE),
+ scale=NULL, inverse=FALSE, flip=FALSE, rotate=0, center=NULL) {
+ if (length(shift) != 2)
+ stop("Two coordinate shift in input units required")
+ if (!is.numeric(shift)) stop("shift not numeric")
+ if (!is.logical(reflect)) stop("reflect must be logical")
+ if (length(reflect) != 2) stop("Two coordinate reflect required")
+ if (!is.logical(flip)) stop("flip must be logical")
+ if (!is.numeric(rotate)) stop("rotate not numeric")
+ if (!is.null(center) && length(center) != 2)
+ stop("center must be numeric of length two")
+ if (is.null(bb)) bb <- bbox(obj)
+ if (rotate != 0 && is.null(center)) center <- bb[,1]
+ if (flip) {
+ yr <- bb[1,] + shift[1]
+ xr <- bb[2,] + shift[2]
+ } else {
+ xr <- bb[1,] + shift[1]
+ yr <- bb[2,] + shift[2]
+ }
+ scale <- scaleCoords(scale=scale, xr=xr, yr=yr)
+ lns <- slot(obj, "lines")
+ new_lns <- lapply(lns, function(x) {
+ Lns <- slot(x, "Lines")
+ new_Lns <- lapply(Lns, function(y) {
+ crds <- slot(y, "coords")
+ ## rotate first, then elide (shift) [side effects if bb, scale or others supplied]
+ if (rotate != 0) crds <- rotateCoords(crds, rotate, center)
+ if (flip) {
+ yc <- crds[,1] + shift[1]
+ xc <- crds[,2] + shift[2]
+ } else {
+ xc <- crds[,1] + shift[1]
+ yc <- crds[,2] + shift[2]
+ }
+ new_crds <- elideCoords(x=xc, y=yc, xr=xr, yr=yr,
+ reflect=reflect, scale=scale)
+ ## if want to elide first, then rotate:
+ ## new_crds <- rotcrds(new_crds,rotate,center)
+ Line(new_crds)})
+ Lines(new_Lns, ID=slot(x, "ID"))})
+ res <- SpatialLines(new_lns)
+ res
+}
+
+elide.linesdf <- function(obj, bb=NULL, shift=c(0, 0), reflect=c(FALSE, FALSE),
+ scale=NULL, inverse=FALSE, flip=FALSE, rotate=0, center=NULL) {
+ res <- elide(as(obj, "SpatialLines"), bb=bb, shift=shift,
+ reflect=reflect, scale=scale, flip=flip, rotate=rotate, center=center)
+ df <- as(obj, "data.frame")
+ res <- SpatialLinesDataFrame(res, data=df)
+ res
+}
+
+setMethod("elide", signature(obj="SpatialLines"), elide.lines)
+
+setMethod("elide", signature(obj="SpatialLinesDataFrame"), elide.linesdf)
+
+elide.polygons <- function(obj, bb=NULL, shift=c(0, 0), reflect=c(FALSE, FALSE),
+ scale=NULL, inverse=FALSE, flip=FALSE, rotate=0, center=NULL) {
+ if (length(shift) != 2)
+ stop("Two coordinate shift in input units required")
+ if (!is.numeric(shift)) stop("shift not numeric")
+ if (!is.logical(reflect)) stop("reflect must be logical")
+ if (length(reflect) != 2) stop("Two coordinate reflect required")
+ if (!is.logical(flip)) stop("flip must be logical")
+ if (!is.numeric(rotate)) stop("rotate not numeric")
+ if (!is.null(center) && length(center) != 2)
+ stop("center must be numeric of length two")
+ if (is.null(bb)) bb <- bbox(obj)
+ if (rotate != 0 && is.null(center)) center <- bb[,1]
+ if (flip) {
+ yr <- bb[1,] + shift[1]
+ xr <- bb[2,] + shift[2]
+ } else {
+ xr <- bb[1,] + shift[1]
+ yr <- bb[2,] + shift[2]
+ }
+ scale <- scaleCoords(scale=scale, xr=xr, yr=yr)
+ pls <- slot(obj, "polygons")
+ new_pls <- lapply(pls, function(x) {
+ Pls <- slot(x, "Polygons")
+ new_Pls <- lapply(Pls, function(y) {
+ crds <- slot(y, "coords")
+ if (rotate != 0) crds <- rotateCoords(crds,rotate,center)
+ if (flip) {
+ yc <- crds[,1] + shift[1]
+ xc <- crds[,2] + shift[2]
+ } else {
+ xc <- crds[,1] + shift[1]
+ yc <- crds[,2] + shift[2]
+ }
+ new_crds <- elideCoords(x=xc, y=yc, xr=xr, yr=yr,
+ reflect=reflect, scale=scale)
+ Polygon(new_crds)})
+ Polygons(new_Pls, ID=slot(x, "ID"))})
+ res <- SpatialPolygons(new_pls)
+ res
+}
+
+elide.polygonsdf <- function(obj, bb=NULL, shift=c(0, 0),
+ reflect=c(FALSE, FALSE), scale=NULL, inverse=FALSE, flip=FALSE,
+ rotate=0, center=NULL) {
+ res <- elide(as(obj, "SpatialPolygons"), bb=bb, shift=shift,
+ reflect=reflect, scale=scale, flip=flip, rotate=rotate, center=center)
+ df <- as(obj, "data.frame")
+ res <- SpatialPolygonsDataFrame(res, data=df)
+ res
+}
+
+setMethod("elide", signature(obj="SpatialPolygons"), elide.polygons)
+
+setMethod("elide", signature(obj="SpatialPolygonsDataFrame"), elide.polygonsdf)
+
+
+
diff --git a/R/gc_dist.R b/R/gc_dist.R
new file mode 100755
index 0000000..5ff4e18
--- /dev/null
+++ b/R/gc_dist.R
@@ -0,0 +1,127 @@
+# 2007 Eric Archer and Roger Bivand
+#
+
+gcDestination <- function(lon, lat, bearing, dist, dist.units = "km",
+ model=NULL, Vincenty=FALSE) {
+ # lat, lon : lattitude and longitude in decimal degrees
+ # bearing : bearing from 0 to 360 degrees
+ # dist : distance travelled
+ # dist.units : units of distance "km" (kilometers), "nm" (nautical
+ # miles), "mi" (statute miles)
+ # model : choice of ellipsoid model ("WGS84", "GRS80", "Airy",
+ # "International", "Clarke", "GRS67")
+
+ if (!is.numeric(lon)) stop("lon not numeric")
+ if (!is.numeric(lat)) stop("lat not numeric")
+ if (!is.numeric(bearing)) stop("bearing not numeric")
+ if (!is.numeric(dist)) stop("dist not numeric")
+
+ if (length(lon) != length(lat)) stop("lon and lat differ in length")
+ if (length(bearing) > 1 && length(lon) > 1) stop("length mismatch")
+ if (length(bearing) > 1 && length(dist) > 1) stop("length mismatch")
+
+ as.radians <- function(degrees) degrees * pi / 180
+ as.degrees <- function(radians) radians * 180 / pi
+ as.bearing <- function(radians) (as.degrees(radians) + 360) %% 360
+
+ ellipsoid <- function(model = "WGS84") {
+ switch(model,
+ WGS84 = c(a = 6378137, b = 6356752.3142, f = 1 / 298.257223563),
+ GRS80 = c(a = 6378137, b = 6356752.3141, f = 1 / 298.257222101),
+ Airy = c(a = 6377563.396, b = 6356256.909, f = 1 / 299.3249646),
+ International = c(a = 6378888, b = 6356911.946, f = 1 / 297),
+ Clarke = c(a = 6378249.145, b = 6356514.86955, f = 1 / 293.465),
+ GRS67 = c(a = 6378160, b = 6356774.719, f = 1 / 298.25),
+ c(a = NA, b = NA, f = NA)
+ )}
+
+ dist <- switch(dist.units,
+ km = dist,
+ nm = dist * 1.852,
+ mi = dist * 1.609344
+ )
+ lat <- as.radians(lat)
+ lon <- as.radians(lon)
+ bearing <- as.radians(bearing)
+
+ if (is.null(model)) {
+ # Code adapted from JavaScript by Chris Veness
+ # (scripts at movable-type.co.uk) at
+ # http://www.movable-type.co.uk/scripts/latlong.html#ellipsoid
+ # originally from Ed Williams' Aviation Formulary,
+ # http://williams.best.vwh.net/avform.htm
+ radius <- 6371
+ psi <- dist / radius
+ lat2 <- asin(sin(lat) * cos(psi) + cos(lat) * sin(psi) * cos(bearing))
+ lon2 <- lon + atan2(sin(bearing) * sin(psi) * cos(lat), cos(psi) -
+ sin(lat) * sin(lat2))
+ if (is.nan(lat2) || is.nan(lon2)) warning("Out of range values")
+ return(cbind(long=as.degrees(lon2), lat=as.degrees(lat2)))
+ }
+
+ ellips <- ellipsoid(model)
+ if (is.na(ellips["a"])) stop("no such ellipsoid model")
+ if (Vincenty) {
+ # Code adapted from JavaScript by Chris Veness
+ # (scripts at movable-type.co.uk) at
+ # http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html
+ # Original reference (http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf):
+ # Vincenty, T. 1975. Direct and inverse solutions of geodesics on
+ # the ellipsoid with application of nested equations.
+ # Survey Review 22(176):88-93
+ dist <- dist * 1000
+ sin.alpha1 <- sin(bearing)
+ cos.alpha1 <- cos(bearing)
+ tan.u1 <- (1 - ellips["f"]) * tan(lat)
+ cos.u1 <- 1 / sqrt(1 + (tan.u1 ^ 2))
+ sin.u1 <- tan.u1 * cos.u1
+ sigma1 <- atan2(tan.u1, cos.alpha1)
+ sin.alpha <- cos.u1 * sin.alpha1
+ cos.sq.alpha <- 1 - (sin.alpha ^ 2)
+ u.sq <- cos.sq.alpha * ((ellips["a"] ^ 2) - (ellips["b"] ^ 2)) /
+ (ellips["b"] ^ 2)
+ cap.A <- 1 + u.sq / 16384 * (4096 + u.sq * (-768 + u.sq * (320 -
+ 175 * u.sq)))
+ cap.B <- u.sq / 1024 * (256 + u.sq * (-128 + u.sq * (74 - 47 * u.sq)))
+
+ sigma <- dist / (ellips["b"] * cap.A)
+ sigma.p <- 2 * pi
+ cos.2.sigma.m <- cos(2 * sigma1 + sigma)
+ while(any(abs(sigma - sigma.p) > 1e-12)) {
+ cos.2.sigma.m <- cos(2 * sigma1 + sigma)
+ sin.sigma <- sin(sigma)
+ cos.sigma <- cos(sigma)
+ delta.sigma <- cap.B * sin.sigma * (cos.2.sigma.m + cap.B / 4 *
+ (cos.sigma *
+ (-1 + 2 * cos.2.sigma.m ^ 2) - cap.B / 6 * cos.2.sigma.m *
+ (-3 + 4 * sin.sigma ^ 2) * (-3 + 4 * cos.2.sigma.m ^ 2)))
+ sigma.p <- sigma
+ sigma <- dist / (ellips["a"] * cap.A) + delta.sigma
+ }
+ tmp <- sin.u1 * sin.sigma - cos.u1 * cos.sigma * cos.alpha1
+ lat2 <- atan2(sin.u1 * cos.sigma + cos.u1 * sin.sigma * cos.alpha1,
+ (1 - ellips["f"]) * sqrt(sin.alpha ^ 2 + tmp ^ 2))
+ lambda <- atan2(sin.sigma * sin.alpha1, cos.u1 * cos.sigma - sin.u1 *
+ sin.sigma * cos.alpha1)
+ cap.C <- ellips["f"] / 16 * cos.sq.alpha * (4 + ellips["f"] *
+ (ellips["f"] - 3 * cos.sq.alpha))
+ cap.L <- lambda - (1 - cap.C) * ellips["f"] * sin.alpha *
+ (sigma + cap.C * sin.sigma * (cos.2.sigma.m + cap.C * cos.sigma *
+ (-1 + 2 * cos.2.sigma.m ^ 2)))
+ lat2 <- as.degrees(lat2)
+ lon2 <- as.degrees(lon + cap.L)
+ } else {
+ # Code adapted from JavaScript by Larry Bogan (larry at go.ednet.ns.ca)
+ # at http://www.go.ednet.ns.ca/~larry/bsc/jslatlng.html
+ e <- 0.08181922
+ radius <- (ellips["a"] / 1000) * (1 - e^2) / ((1 - e^2 *
+ sin(lat)^2)^1.5)
+ psi <- dist / radius
+ phi <- pi / 2 - lat
+ arc.cos <- cos(psi) * cos(phi) + sin(psi) * sin(phi) * cos(bearing)
+ lat2 <- as.degrees((pi / 2) - acos(arc.cos))
+ arc.sin <- sin(bearing) * sin(psi) / sin(phi)
+ lon2 <- as.degrees(lon + asin(arc.sin))
+ }
+ return(cbind(long=lon2, lat=lat2))
+}
diff --git a/R/getKMLcoordinates.R b/R/getKMLcoordinates.R
new file mode 100644
index 0000000..a1cfa11
--- /dev/null
+++ b/R/getKMLcoordinates.R
@@ -0,0 +1,22 @@
+
+getKMLcoordinates <- function(kmlfile, ignoreAltitude = FALSE) {
+ if (missing(kmlfile))
+ stop("kmlfile is missing")
+ kml <- paste(readLines(kmlfile, encoding = "UTF-8"),
+ collapse = " ")
+ re <- "<coordinates> *([^<]+?) *<\\/coordinates>"
+ mtchs <- gregexpr(re, kml)[[1]]
+ coords <- list()
+ for (i in 1:(length(mtchs))) {
+ kmlCoords <- unlist(strsplit(gsub(re, "\\1", substr(kml,
+ mtchs[i], (mtchs[i] + attr(mtchs, "match.length")[i])),
+ perl = TRUE), split = " "))
+ m <- t(as.matrix(sapply(kmlCoords, function(x) as.numeric(unlist(
+ strsplit(x, ","))), USE.NAMES = FALSE)))
+ if (!ignoreAltitude && dim(m)[2] != 3)
+ message(paste("no altitude values for KML object", i))
+ coords <- append(coords,
+ ifelse(ignoreAltitude, list(m[, 1:2]), list(m)))
+ }
+ coords
+}
diff --git a/R/kmlLine.R b/R/kmlLine.R
new file mode 100755
index 0000000..377aa9d
--- /dev/null
+++ b/R/kmlLine.R
@@ -0,0 +1,70 @@
+
+kmlLine <- function(obj = NULL, kmlfile = NULL, name = "R Line",
+ description = "", col = NULL, visibility = 1, lwd = 1,
+ kmlname = "", kmldescription = "") {
+ if (is.null(obj))
+ return(list(header = c("<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+ "<kml xmlns=\"http://earth.google.com/kml/2.2\">",
+ "<Document>", paste("<name>", kmlname, "</name>",
+ sep = ""), paste("<description><![CDATA[",
+ kmldescription, "]]></description>", sep = "")),
+ footer = c("</Document>", "</kml>")))
+ if (class(obj) != "Lines" && class(obj) != "SpatialLinesDataFrame")
+ stop("obj must be of class 'Lines' or 'SpatialLinesDataFrame' [package 'sp']")
+ if (class(obj) == "SpatialLinesDataFrame") {
+ if (length(obj at lines) > 1)
+ warning(paste("Only the first Polygons object with the ID '",
+ obj at lines[[1]]@ID, "' is taken from 'obj'",
+ sep = ""))
+ obj <- obj at lines[[1]]
+ }
+
+ col2kmlcolor <- function(col) paste(rev(sapply(col2rgb(col,
+ TRUE), function(x) sprintf("%02x", x))), collapse = "")
+
+ kml <- kmlStyle <- ""
+
+ kmlHeader <- c("<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+ "<kml xmlns=\"http://earth.google.com/kml/2.2\">",
+ "<Document>", paste("<name>", kmlname, "</name>",
+ sep = ""), paste("<description><![CDATA[", kmldescription,
+ "]]></description>", sep = ""))
+ kmlFooter <- c("</Document>", "</kml>")
+
+ kmlStyle <- append(kmlStyle, paste("<Style id=\"", obj at ID,
+ "\">", sep = ""))
+ kmlStyle <- append(kmlStyle, "<LineStyle>")
+ kmlStyle <- append(kmlStyle, paste("<width>", lwd, "</width>",
+ sep = ""))
+ kmlStyle <- append(kmlStyle, paste("<color>", col2kmlcolor(col),
+ "</color>", sep = ""))
+ kmlStyle <- append(kmlStyle, "</LineStyle>")
+ kmlStyle <- append(kmlStyle, "</Style>")
+
+ kml <- append(kml, "<Placemark>")
+ kml <- append(kml, paste("<name>", name, "</name>", sep = ""))
+ kml <- append(kml, paste("<description><![CDATA[", description,
+ "]]></description>", sep = ""))
+ kml <- append(kml, paste("<styleUrl>#", obj at ID, "</styleUrl>",
+ sep = ""))
+ kml <- append(kml, paste("<visibility>", as.integer(visibility),
+ "</visibility>", sep = ""))
+ kml <- append(kml, "<MultiGeometry>")
+
+ for (i in 1:length(obj at Lines)) {
+ kml <- append(kml, "<LineString>")
+ kml <- append(kml, "<tessellate>1</tessellate>")
+ kml <- append(kml, "<coordinates>")
+ kml <- append(kml, paste(coordinates(obj at Lines[[i]])[,
+ 1], coordinates(obj at Lines[[i]])[, 2], sep = ","))
+ kml <- append(kml, "</coordinates>")
+ kml <- append(kml, "</LineString>")
+ }
+ kml <- append(kml, "</MultiGeometry>")
+ kml <- append(kml, "</Placemark>")
+
+ if (!is.null(kmlfile))
+ cat(paste(c(kmlHeader, kmlStyle, kml, kmlFooter),
+ sep = "", collapse = "\n"), "\n", file = kmlfile, sep = "")
+ else list(style = kmlStyle, content = kml)
+}
diff --git a/R/kmlPolygon.R b/R/kmlPolygon.R
new file mode 100755
index 0000000..1932b7c
--- /dev/null
+++ b/R/kmlPolygon.R
@@ -0,0 +1,94 @@
+
+kmlPolygon <- function(obj = NULL, kmlfile = NULL, name = "R Polygon",
+ description = "", col = NULL, visibility = 1, lwd = 1,
+ border = 1, kmlname = "", kmldescription = "") {
+ if (is.null(obj))
+ return(list(header = c("<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+ "<kml xmlns=\"http://earth.google.com/kml/2.2\">",
+ "<Document>", paste("<name>", kmlname, "</name>",
+ sep = ""), paste("<description><![CDATA[",
+ kmldescription, "]]></description>", sep = "")),
+ footer = c("</Document>", "</kml>")))
+ if (class(obj) != "Polygons" && class(obj) != "SpatialPolygonsDataFrame")
+ stop("obj must be of class 'Polygons' or 'SpatialPolygonsDataFrame' [package 'sp']")
+ if (class(obj) == "SpatialPolygonsDataFrame") {
+ if (length(obj at polygons) > 1)
+ warning(paste("Only the first Polygons object with the ID '",
+ obj at polygons[[1]]@ID, "' is taken from 'obj'",
+ sep = ""))
+ obj <- obj at polygons[[1]]
+ }
+
+ col2kmlcolor <- function(col) paste(rev(sapply(col2rgb(col,
+ TRUE), function(x) sprintf("%02x", x))), collapse = "")
+
+ kml <- kmlStyle <- ""
+
+ kmlHeader <- c("<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+ "<kml xmlns=\"http://earth.google.com/kml/2.2\">",
+ "<Document>", paste("<name>", kmlname, "</name>",
+ sep = ""), paste("<description><![CDATA[", kmldescription,
+ "]]></description>", sep = ""))
+ kmlFooter <- c("</Document>", "</kml>")
+
+ kmlStyle <- append(kmlStyle, paste("<Style id=\"", obj at ID,
+ "\">", sep = ""))
+ kmlStyle <- append(kmlStyle, "<LineStyle>")
+ kmlStyle <- append(kmlStyle, paste("<width>", lwd, "</width>",
+ sep = ""))
+ kmlStyle <- append(kmlStyle, paste("<color>", col2kmlcolor(border),
+ "</color>", sep = ""))
+ kmlStyle <- append(kmlStyle, "</LineStyle>")
+ kmlStyle <- append(kmlStyle, "<PolyStyle>")
+
+ if (is.null(col)) {
+ kmlStyle <- append(kmlStyle, "<fill>0</fill>")
+ }
+ else {
+ kmlStyle <- append(kmlStyle, paste("<color>", col2kmlcolor(col),
+ "</color>", sep = ""))
+ kmlStyle <- append(kmlStyle, "<fill>1</fill>")
+ }
+
+ kmlStyle <- append(kmlStyle, "</PolyStyle>")
+ kmlStyle <- append(kmlStyle, "</Style>")
+
+ kml <- append(kml, "<Placemark>")
+ kml <- append(kml, paste("<name>", name, "</name>", sep = ""))
+ kml <- append(kml, paste("<description><![CDATA[", description,
+ "]]></description>", sep = ""))
+ kml <- append(kml, paste("<styleUrl>#", obj at ID, "</styleUrl>",
+ sep = ""))
+ kml <- append(kml, paste("<visibility>", as.integer(visibility),
+ "</visibility>", sep = ""))
+ kml <- append(kml, "<MultiGeometry>")
+ holeFlag <- FALSE
+ for (i in 1:length(obj at Polygons)) {
+ if (!holeFlag)
+ kml <- append(kml, "<Polygon>")
+ kml <- append(kml, ifelse(obj at Polygons[[i]]@hole,
+ "<innerBoundaryIs>", "<outerBoundaryIs>"))
+ kml <- append(kml, c("<LinearRing>", "<coordinates>"))
+ kml <- append(kml, paste(coordinates(obj at Polygons[[i]])[, 1],
+ coordinates(obj at Polygons[[i]])[, 2], sep = ","))
+ kml <- append(kml, c("</coordinates>", "</LinearRing>"))
+ kml <- append(kml, ifelse(obj at Polygons[[i]]@hole,
+ "</innerBoundaryIs>", "</outerBoundaryIs>"))
+ # check if next polygon is an hole, if so export it as innerBoundaryIs;
+ # this only works if the holes are following that polygon
+ # which contains these holes regardingless plotOrder;
+ # TODO: rearrange holes according to 'their' polygons automatically via
+ # hole.in.which.polygon?
+ holeFlag <- ifelse((i + 1) <= length(obj at Polygons),
+ obj at Polygons[[i + 1]]@hole, FALSE)
+ if (!holeFlag)
+ kml <- append(kml, "</Polygon>")
+ }
+ kml <- append(kml, "</MultiGeometry>")
+ kml <- append(kml, "</Placemark>")
+
+ if (!is.null(kmlfile))
+ cat(paste(c(kmlHeader, kmlStyle, kml, kmlFooter),
+ sep = "", collapse = "\n"), "\n", file = kmlfile, sep = "")
+ else list(style = kmlStyle, content = kml)
+}
diff --git a/R/maptools.R b/R/maptools.R
new file mode 100644
index 0000000..04f58a1
--- /dev/null
+++ b/R/maptools.R
@@ -0,0 +1,952 @@
+# Copyright 2000-2001 (c) Nicholas Lewin-Koh
+# modifications 2001-2005 Roger Bivand,
+# shape2poly based on code by Stephane Dray
+
+plot.polylist <- function(x, col, border=par("fg"), add=FALSE,
+ xlim=NULL, ylim=NULL, xlab="", ylab="", xpd=NULL,
+ density=NULL, angle=45, pbg=NULL, forcefill=TRUE, ...) {
+ .Deprecated("", package="sp", msg="objects other than Spatial objects defined in the sp package are deprecated")
+ if (!inherits(x, "polylist")) stop("Not a polygon list")
+
+ usrpoly <- function(x) {
+ p <- matrix(c(x[1], x[2], x[2], x[1], x[3], x[3],
+ x[4], x[4]), ncol=2)
+ p
+ }
+ if (!add) {
+ maplim <- attr(x, "maplim")
+ if (is.null(maplim))
+ if (is.null(xlim) || is.null(ylim))
+ stop("map limits missing")
+ if (is.null(xlim)) xlim <- maplim$x
+ if (is.null(ylim)) ylim <- maplim$y
+ plot(x=xlim, y=ylim, xlim=xlim, ylim=ylim, type="n",
+ asp=1, xlab=xlab, ylab=ylab, ...)
+ if (!forcefill && !is.null(pbg)) {
+ polygon(usrpoly(par("usr")), col = pbg, border = NA)
+ box()
+ }
+ }
+ pO <- attr(x, "plotOrder")
+ if (length(x) < 1) stop("zero length polylist")
+ if (is.null(pO) || length(x) != length(pO)) pO <- 1:length(x)
+ pO <- as.integer(pO)
+ if (length(pO) != length(unique(pO))) stop("malformed plot order")
+ if (!identical(sort(pO), sort(1:length(x)))) stop("malformed plot order")
+ if (missing(col)) {
+ if (length(density) != length(x)) {
+ density <- rep(density, length(x), length(x))
+ }
+ if (length(angle) != length(x)) {
+ angle <- rep(angle, length(x), length(x))
+ }
+ for (j in pO) polygonholes(x[[j]], border=border,
+ xpd=xpd, density=density[j], angle=angle[j],
+ pbg=pbg, forcefill=forcefill)
+ } else {
+ if (length(col) != length(x)) {
+ col <- rep(col, length(x), length(x))
+ }
+ for (j in pO)
+ polygonholes(x[[j]], col=col[j], border=border,
+ xpd=xpd, pbg=pbg, forcefill=forcefill)
+ }
+ if (!missing(col) | !is.null(density)) {
+ if (forcefill)
+ warning("From next major release, default fill behaviour will change")
+ }
+}
+
+polygonholes <- function(coords, col=NA, border=NULL, xpd=NULL, density=NULL,
+ angle=45, pbg=par("bg"), forcefill=TRUE) {
+ nParts <- attr(coords, "nParts")
+ if (is.null(nParts)) nParts <- 1
+ pFrom <- attr(coords, "pstart")$from
+ if (is.null(pFrom)) pFrom <- 1
+ pTo <- attr(coords, "pstart")$to
+ if (is.null(pTo)) pTo <- dim(coords)[1]
+ if (is.na(col)) hatch <- TRUE
+ else hatch <- FALSE
+ pO <- attr(coords, "plotOrder")
+ if (is.null(pO)) pO <- 1:nParts
+ for (i in pO) {
+ if (hatch) {
+ if (forcefill || attr(coords, "ringDir")[i] == 1) {
+ polygon(coords[pFrom[i]:pTo[i],],
+ border = border, xpd = xpd,
+ density = density, angle = angle)
+ } else {
+ polygon(coords[pFrom[i]:pTo[i],],
+ border = border, xpd = xpd, col=pbg,
+ density = NULL)
+ }
+ } else {
+ if (forcefill || attr(coords, "ringDir")[i] == 1) {
+ polygon(coords[pFrom[i]:pTo[i],],
+ border = border, xpd = xpd, col=col)
+ } else {
+ polygon(coords[pFrom[i]:pTo[i],],
+ border = border, xpd = xpd, col=pbg)
+ }
+ }
+ }
+}
+
+
+plotpolys <- function(pl, bb, col=NA, border=par("fg"), add=FALSE,
+ xlim=NULL, ylim=NULL, ...) {
+ .Deprecated("plot.polylist", package="maptools")
+ if (!inherits(pl, "polylist")) stop("Not a polygon list")
+ if (!add) {
+ maplim <- attr(pl, "maplim")
+ if (is.null(maplim) && missing(bb))
+ if (is.null(xlim) || is.null(ylim))
+ stop("map limits missing")
+ if (is.null(xlim)) {
+ if (is.null(maplim))
+ xlim <- c(min(bb[,1]), max(bb[,3]))
+ else xlim <- maplim$x
+ }
+ if (is.null(ylim)) {
+ if (is.null(maplim))
+ ylim <- c(min(bb[,2]), max(bb[,4]))
+ else ylim <- maplim$y
+ }
+ plot(x=xlim, y=ylim, xlim=xlim, ylim=ylim, type="n",
+ asp=1, xlab="", ylab="")
+ }
+ if (length(col) != length(pl)) {
+ col <- rep(col, length(pl), length(pl))
+ }
+ for (j in 1:length(pl)) polygon(pl[[j]], col=col[j], border=border, ...)
+}
+
+shape2poly <- function(shape, region.id=NULL) {
+ if (is.null(shape$shp)) stop("No shp component in this list")
+ if (shape$shp$header$shape.type != 5) stop("Not a polygon shapefile")
+ nrecord <- length(shape$shp$shp)
+ res <- vector(mode="list", length=nrecord)
+ if (is.null(region.id) || length(region.id) != nrecord) {
+ attr(res, "region.id") <- as.character(1:nrecord)
+ } else {
+ attr(res, "region.id") <- as.character(region.id)
+ }
+ np <- integer(nrecord)
+ for (i in 1:nrecord) np[i] <- shape$shp$shp[[i]]$num.parts
+ for (i in 1:nrecord) {
+ if (np[i] > 1) {
+ res[[i]] <- .getMultishape(shape$shp$shp[[i]], np[i])
+ } else {
+ res[[i]] <- as.matrix(shape$shp$shp[[i]]$points)
+ attr(res[[i]], "pstart") <- list(from=1,
+ to=shape$shp$shp[[i]]$num.points)
+ rownames(res[[i]]) <- NULL
+ colnames(res[[i]]) <- NULL
+ }
+ attr(res[[i]], "nParts") <- np[i]
+ rD <- integer(np[i])
+ for (j in 1:np[i]) rD[j] <- ringDir(res[[i]], j)
+ attr(res[[i]], "ringDir") <- rD
+ attr(res[[i]], "bbox") <- as.vector(shape$shp$shp[[i]]$box)
+ }
+
+ class(res) <- "polylist"
+ attr(res, "maplim") <- shp2maplim(shape)
+ return(res)
+
+}
+
+shape2lines <- function(shape) {
+ if (is.null(shape$shp)) stop("No shp component in this list")
+ if (shape$shp$header$shape.type != 3) stop("maptype not line/arc")
+ n <- length(shape$shp$shp)
+ res <- vector(mode="list", length=n)
+ nParts <- integer(n)
+ for (i in 1:n) nParts[i] <- shape$shp$shp[[i]]$num.parts
+ for (i in 1:n) {
+ if (nParts[i] > 1)
+ res[[i]] <- .getMultishape(shape$shp$shp[[i]],
+ nParts[i])
+ else {
+ res[[i]] <- as.matrix(shape$shp$shp[[i]]$points)
+ attr(res[[i]], "pstart") <- list(from=1,
+ to=shape$shp$shp[[i]]$num.points)
+ rownames(res[[i]]) <- NULL
+ colnames(res[[i]]) <- NULL
+ }
+ attr(res[[i]], "nParts") <- nParts[i]
+ }
+ class(res) <- "lineslist"
+ attr(res, "maplim") <- shp2maplim(shape)
+ res
+}
+
+shape2points <- function(shape) {
+ if (is.null(shape$shp)) stop("No shp component in this list")
+ if (shape$shp$header$shape.type != 1)
+ stop("maptype not points")
+# n <- length(shape$shp$shp)
+ res <- shape$shp$shp[,2:3]
+ class(res) <- "Mappoints"
+ attr(res, "maplim") <- shp2maplim(shape)
+ res
+}
+
+
+# based on SHPRingDir_2d, modified to use current ring only, and to strip
+# out last vertex if identical with first
+
+ringDir <- function(xy, ring) {
+ nParts <- attr(xy, "nParts")
+ if (ring > nParts) stop("ring too large")
+ from <- attr(xy, "pstart")$from
+ to <- attr(xy, "pstart")$to
+ a <- xy[from[ring]:to[ring],1]
+ b <- xy[from[ring]:to[ring],2]
+ nvx <- length(b)
+
+ if((a[1] == a[nvx]) && (b[1] == b[nvx])) {
+ a <- a[-nvx]
+ b <- b[-nvx]
+ nvx <- nvx - 1
+ }
+
+ tX <- 0.0
+ dfYMax <- max(b)
+ ti <- 1
+ for (i in 1:nvx) {
+ if (b[i] == dfYMax && a[i] > tX) ti <- i
+ }
+ if ( (ti > 1) & (ti < nvx) ) {
+ dx0 = a[ti-1] - a[ti]
+ dx1 = a[ti+1] - a[ti]
+ dy0 = b[ti-1] - b[ti]
+ dy1 = b[ti+1] - b[ti]
+ } else if (ti == nvx) {
+ dx0 = a[ti-1] - a[ti]
+ dx1 = a[1] - a[ti]
+ dy0 = b[ti-1] - b[ti]
+ dy1 = b[1] - b[ti]
+ } else {
+# /* if the tested vertex is at the origin then continue from 0 (1) */
+ dx1 = a[2] - a[1]
+ dx0 = a[nvx] - a[1]
+ dy1 = b[2] - b[1]
+ dy0 = b[nvx] - b[1]
+ }
+ v3 = ( (dx0 * dy1) - (dx1 * dy0) )
+ if ( v3 > 0 ) return (1)
+ else return (-1)
+}
+
+shp2maplim <- function(shape) {
+ if (is.null(shape$shp)) stop("No shp component in this list")
+ mapxlim<-c(shape$shp$header$xmin, shape$shp$header$xmax)
+ mapylim<-c(shape$shp$header$ymin, shape$shp$header$ymax)
+ list(x=mapxlim, y=mapylim)
+}
+
+.getMultishape <- function(shp, nParts) {
+ Pstart <- shp$parts
+ nVerts <- shp$num.points
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ for (j in 1:nParts) {
+ if (j == nParts) to[j] <- nVerts
+ else {
+ to[j] <- Pstart[j+1]
+ from[j+1] <- to[j]+1
+ }
+ }
+ res <- as.matrix(shp$points[from[1]:to[1],])
+ if (nParts > 1) {
+ for (j in 2:nParts) {
+ res <- rbind(res, c(NA, NA))
+ res <- rbind(res, as.matrix(shp$points[from[j]:to[j],]))
+ }
+ }
+ rownames(res) <- NULL
+ colnames(res) <- NULL
+ for (j in 1:nParts) {
+ from[j] <- from[j] + (j-1)
+ to[j] <- to[j] + (j-1)
+ }
+ attr(res, "pstart") <- list(from=from, to=to)
+ res
+}
+
+shape2bbs <- function(shape) {
+ if (is.null(shape$shp)) stop("No shp component in this list")
+ if (shape$shp$header$shape.type != 5) stop("Not a polygon shapefile")
+ n <- length(shape$shp$shp)
+ res <- matrix(0, ncol=4, nrow=n)
+ for (i in 1:n) res[i,] <- as.vector(shape$shp$shp[[i]]$box)
+ res
+}
+
+Map2lines <- function(Map) {
+ .Deprecated("", package="sp", msg="objects other than Spatial objects defined in the sp package are deprecated")
+ if (class(Map) != "Map") stop("not a Map")
+ if (attr(Map$Shapes,'shp.type') != 'arc')
+ stop("maptype not line/arc")
+ n <- attr(Map$Shapes,'nshps')
+ res <- vector(mode="list", length=n)
+ nParts <- integer(n)
+ for (i in 1:n) nParts[i] <- attr(Map$Shapes[[i]], "nParts")
+ for (i in 1:n) {
+ if (nParts[i] > 1)
+ res[[i]] <- .getMultiShp(Map$Shapes[[i]], nParts[i])
+ else {
+ res[[i]] <- Map$Shapes[[i]]$verts
+ attr(res[[i]], "pstart") <- list(from=1,
+ to=attr(Map$Shapes[[i]], "nVerts"))
+ }
+ attr(res[[i]], "nParts") <- nParts[i]
+ shpID <- attr(Map$Shapes[[i]], "shpID")
+ attr(res[[i]], "shpID") <- ifelse (is.null(shpID), as.integer(NA), shpID)
+ }
+ class(res) <- "lineslist"
+ attr(res, "maplim") <- Map2maplim(Map)
+ res
+}
+
+Map2points <- function(Map) {
+ .Deprecated("", package="sp", msg="objects other than Spatial objects defined in the sp package are deprecated")
+ if (class(Map) != "Map") stop("not a Map")
+ if (attr(Map$Shapes,'shp.type') != 'point')
+ stop("maptype not points")
+ n <- attr(Map$Shapes,'nshps')
+ ncols <- 2
+ if (attr(Map$Shapes[[1]], "shp.type") == 11) ncols <- 3
+ res <- matrix(NA, nrow=n, ncol=ncols)
+ shpIDs <- integer(n)
+ for (i in 1:n) {
+ res[i,] <- Map$Shapes[[i]]$verts
+ shpID <- attr(Map$Shapes[[i]], "shpID")
+ shpIDs[i] <- ifelse (is.null(shpID), as.integer(NA), shpID)
+ }
+ class(res) <- "Mappoints"
+ attr(res, "maplim") <- Map2maplim(Map)
+ attr(res, "shpID") <- shpIDs
+ res
+}
+
+Map2poly <- function(Map, region.id=NULL, quiet=TRUE) {
+ .Deprecated("", package="sp", msg="objects other than Spatial objects defined in the sp package are deprecated")
+ if (class(Map) != "Map") stop("not a Map")
+ if (attr(Map$Shapes,'shp.type') != 'poly')
+ stop("maptype not poly")
+ if (!is.null(region.id))
+ if (length(region.id) != length(unique(region.id)))
+ stop("region.id not unique")
+ res <- .get.polylist1(Map=Map, region.id=region.id, quiet=quiet)
+ attr(res, "maplim") <- Map2maplim(Map)
+ area <- sapply(res, function(x) attr(x, "area"))
+ pO <- order(area, decreasing=TRUE)
+ after <- as.integer(rep(NA, attr(Map$Shapes,'nshps')))
+
+ attr(res, "after") <- after
+ attr(res, "plotOrder") <- pO
+
+ nD <- unique(sapply(res, function(x) dim(x)[2]))
+ if (length(nD) > 1) stop("multiple dimension polylist components")
+ nD <- as.integer(nD)
+ attr(res, "nDims") <- nD
+
+ res
+}
+
+
+Map2poly1 <- function(Map, region.id=NULL, raw=TRUE) {
+ .Deprecated("", package="sp", msg="objects other than Spatial objects defined in the sp package are deprecated")
+ if (class(Map) != "Map") stop("not a Map")
+ if (attr(Map$Shapes,'shp.type') != 'poly')
+ stop("maptype not poly")
+ if (!is.null(region.id))
+ if (length(region.id) != length(unique(region.id)))
+ stop("region.id not unique")
+ res <- .get.polylist(Map=Map, region.id=region.id, raw=raw)
+ attr(res, "maplim") <- Map2maplim(Map)
+ pO <- as.integer(1:attr(Map$Shapes,'nshps'))
+ after <- as.integer(rep(NA, attr(Map$Shapes,'nshps')))
+ rD <- sapply(res, function(x)
+ attr(x, "ringDir")[attr(x, "plotOrder")[1]])
+ r1 <- .mtInsiders(res, rD)
+ if (!all(sapply(r1, is.null))) {
+ lres <- .mtlbuild(.mtafters(r1), rD)
+ pO <- lres$pO
+ after <- lres$after
+ }
+# pO <- as.integer(1:attr(Map$Shapes,'nshps'))
+# after <- as.integer(rep(NA, attr(Map$Shapes,'nshps')))
+# r1 <- .mtInsiders(res)
+# if (!all(sapply(r1, is.null))) {
+# after <- as.integer(sapply(r1,
+# function(x) ifelse(is.null(x), NA, max(x))))
+# pO <- order(after, na.last=FALSE)
+# }
+ attr(res, "after") <- after
+ attr(res, "plotOrder") <- pO
+ if (!raw) {
+ rD <- sapply(res, function(x) attr(x,
+ "ringDir")[which(attr(x, "plotOrder") == 1)])
+ if (any((rD == -1) & is.na(after))) {
+ oddCC <- which((rD == -1) & is.na(after))
+ for (i in oddCC) {
+ tgt <- which(attr(res[[i]], "plotOrder") == 1)
+ nParts <- attr(res[[i]], "nParts")
+ tmp <- as.matrix(res[[i]])
+ from <- attr(res[[i]], "pstart")$from[tgt]
+ to <- attr(res[[i]], "pstart")$to[tgt]
+ tmp[from:to,] <- res[[i]][to:from, ]
+ attributes(tmp) <- attributes(res[[i]])
+ rD <- vector(length=nParts, mode="integer")
+ for (j in 1:nParts) rD[j] <- ringDir(tmp, j)
+ attr(tmp, "ringDir") <- rD
+ res[[i]] <- tmp
+ warning(paste("ring direction changed in polygon", i))
+ }
+ }
+ }
+ if (raw) warning("From next release, default hole handling will change")
+ res
+}
+
+.mtInsiders <- function(pl, rD) {
+ bbox1 <- function(x) {
+ r1 <- range(x[,1], na.rm=TRUE)
+ r2 <- range(x[,2], na.rm=TRUE)
+ res <- c(r1[1], r2[1], r1[2], r2[2])
+ res
+ }
+
+ n <- length(pl)
+ bbs <- matrix(0, nrow=n, ncol=4)
+ for (i in 1:n) bbs[i,] <- bbox1(pl[[i]])
+ res <- .Call("mtInsiders", as.integer(n), as.double(bbs),
+ PACKAGE="maptools")
+ res1 <- vector(mode="list", length=n)
+
+ for (i in 1:n) {
+ if (!is.null(res[[i]])) {
+ ri <- res[[i]]
+ ixc <- pl[[i]][1,1]
+ iyc <- pl[[i]][1,2]
+ int <- logical(length(ri))
+ for (j in 1:length(ri)) {
+ xj <- pl[[ri[j]]]
+ jxc <- na.omit(xj[,1])
+ jyc <- na.omit(xj[,2])
+ pip <- maptools:::mt.point.in.polygon(ixc,
+ iyc, jxc, jyc)
+ int[j] <- ((pip == 1) | (pip > 1))
+# int[j] <- ((pip == 1) |
+# ((pip > 1) & ((rD[i] == 1) &
+# (rD[ri[j]] == -1))))
+
+ }
+ rj <- ri[int]
+ if (length(rj) > 0) {
+ res1[[i]] <- as.integer(rj)
+ }
+ }
+ }
+ res1
+}
+
+.mtafters <- function(rl) {
+
+# argument is output from .insiders() - a list with either NULL components
+# (not included in any other polygon) or lists of polygons in which the polygon
+# in question is included; outputs a from:to matrix
+
+ n <- length(rl)
+ res <- NULL
+ for (i in 1:n) {
+ if (is.null(rl[[i]]))
+ res <- rbind(res, c(i, NA))
+ else {
+ for (j in 1:length(rl[[i]])) {
+ res <- rbind(res, c(i, rl[[i]][j]))
+ }
+ }
+ }
+ res
+}
+
+.mtlbuild1 <- function(x) {
+
+# reverse list builder with from:to matrix as argument, used to try to find
+# circularities
+
+ lx <- vector(mode="list", length=length(unique(x[,1])))
+ rle.x <- rle(x[,1])
+ cs1.x <- cumsum(rle.x$lengths)
+ cs0.x <- c(1, cs1.x[1:(length(lx)-1)]+1)
+ ii <- 1
+ for (i in 1:length(lx)) {
+ if (rle.x$value[ii] == i) {
+ lx[[i]] <- as.integer(x[cs0.x[ii]:cs1.x[ii],2])
+ ii <- ii+1
+ }
+ }
+ lx
+}
+
+.mtcircs <- function(x) {
+
+# try to find circularities from reverse list as argument (polygons reported
+# as being inside each other despite checking ring direction in .insiders);
+# only the first loop will be run in normal cases
+
+ res <- NULL
+ for (i in 1:length(x)) {
+ if (!is.na(match(i, unlist(x[x[[i]]])))) {
+ hits <- rep(FALSE, length(x[[i]]))
+ for (j in 1:length(hits)) {
+ jj <- x[[i]][j]
+ hits[j] <- (i %in% x[[jj]])
+ }
+ if (length(which(hits)) > 1) stop("multiple circulars")
+ pair <- c(i, x[[i]][hits])
+ res <- rbind(res, pair)
+ }
+ }
+ res1 <- NULL
+ if (!is.null(res)) {
+ if (nrow(res) %% 2 != 0) stop("odd circulars")
+ gone <- rep(FALSE, nrow(res))
+ for (i in 1:nrow(res)) {
+ if (!gone[i]) {
+ from <- res[i,1]
+ to <- res[i,2]
+ hit <- match(from, res[,2])
+ if (!gone[hit]) {
+ if (res[hit,1] != to)
+ stop("mismatched circular")
+ res1 <- rbind(res1, c(from, to))
+ gone[i] <- TRUE
+ }
+ }
+ }
+ }
+ res1
+}
+
+.mtlbuild <- function(x, rD) {
+
+# list analysis of matrix output from .afters combined with current ring
+# directions (which may be quite wrong) to generate a plot order and
+# vector of afters (NA for no dependency, 1 for dependency on being plotted
+# after another polygon)
+
+ ids <- x[,1]
+ ins <- x[,2]
+ n <- length(unique(ids))
+ nas <- which(is.na(ins))
+ ntop <- length(nas)
+ pO <- vector(length=n, mode="integer")
+ after <- rep(as.integer(NA), length=n)
+ gone <- rep(FALSE, n)
+ j <- 1
+ for (i in 1:ntop) {
+ ii <- ids[nas[i]]
+ if (!gone[ii]) {
+ gone[ii] <- TRUE
+ pO[j] <- ii
+#cat("level 1:", j, ii, "\n")
+ j <- j+1
+ } else warning(paste("level 1 circularity at", ii))
+ ihits <- which(ins == ii)
+
+# for each top level (not inside any other) polygon, check to see if any
+# polygons are inside it, and insert orders to match; from outer to deepest in;
+# the gone vector is used to avoid multiple assignments to the plot
+# order list that can happen with circularity
+
+ if (length(ihits) > 0) {
+ tihits <- ids[ihits]
+ rtihits <- rle(ids[ids %in%tihits])
+ o <- order(rtihits$lengths)
+ for (jj in 1:length(rtihits$values)) {
+ jjj <- rtihits$values[o][jj]
+ if (!gone[jjj]) {
+ gone[jjj] <- TRUE
+ pO[j] <- jjj
+cat("level 2:", j, ii, "\n")
+ j <- j+1
+ } else warning(paste("level 2 circularity at",
+ jjj))
+ after[jjj] <- as.integer(1)
+ }
+ }
+ }
+ xcircs <- .mtcircs(.mtlbuild1(x))
+
+# Further attempts to trap circularities, possibly no longer needed, first
+# introduced before point-in-polygon test added to .insiders; TODO check
+# whether is.null(xcircs) is always TRUE
+
+ if (!is.null(xcircs)) {
+ for (i in 1:nrow(xcircs)) {
+ from <- xcircs[i,1]
+ to <- xcircs[i,2]
+ rDfrom <- rD[from]
+ rDto <- rD[to]
+ pOfrom <- which(pO == from)
+ pOto <- which(pO == to)
+ if (rDfrom == 1) {
+ if (pOfrom < pOto) {
+ pO[pOto] <- from
+ pO[pOfrom] <- to
+ }
+ }
+ if (rDto == 1) {
+ if (pOfrom > pOto) {
+ pO[pOto] <- from
+ pO[pOfrom] <- to
+ }
+ }
+ }
+ }
+ list(pO=pO, after=after)
+}
+
+.get.polylist <- function(Map, region.id=NULL, raw=TRUE) {
+ n <- attr(Map$Shapes,'nshps')
+ res <- vector(mode="list", length=n)
+ nParts <- integer(n)
+ for (i in 1:n) nParts[i] <- attr(Map$Shapes[[i]], "nParts")
+ for (i in 1:n) {
+ if (nParts[i] > 1) {
+ res[[i]] <- .getMultiShp(Map$Shapes[[i]], nParts[i],
+ raw=raw)
+ } else {
+ res[[i]] <- Map$Shapes[[i]]$verts
+ attr(res[[i]], "pstart") <- list(from=as.integer(1),
+ to=as.integer(nrow(Map$Shapes[[i]]$verts)))
+# attr(Map$Shapes[[i]], "nVerts"))
+ attr(res[[i]], "after") <- 1
+ attr(res[[i]], "plotOrder") <- 1
+ attr(res[[i]], "bbox") <-
+ as.vector(attr(Map$Shapes[[i]], "bbox"))
+ attr(res[[i]], "RingDir") <-
+ as.vector(attr(Map$Shapes[[i]], "RingDir"))
+ attr(res[[i]], "nParts") <- nParts[i]
+ attr(res[[i]], "ringDir") <- ringDir(res[[i]], 1)
+ }
+# attr(res[[i]], "shpID") <- attr(Map$Shapes[[i]], "shpID")
+ shpID <- attr(Map$Shapes[[i]], "shpID")
+ attr(res[[i]], "shpID") <- ifelse (is.null(shpID), as.integer(NA), shpID) }
+ if (is.null(region.id) || length(region.id) != n) {
+ attr(res, "region.id") <- as.character(1:n)
+ } else {
+ attr(res, "region.id") <- as.character(region.id)
+ }
+ class(res) <- "polylist"
+ invisible(res)
+}
+.get.polylist1 <- function(Map, region.id=NULL, quiet=TRUE) {
+ n <- attr(Map$Shapes,'nshps')
+ res <- vector(mode="list", length=n)
+ nParts <- integer(n)
+ for (i in 1:n) nParts[i] <- attr(Map$Shapes[[i]], "nParts")
+ for (i in 1:n) {
+ if (nParts[i] > 1) {
+ res[[i]] <- .getMultiShp1(Map$Shapes[[i]], nParts[i],
+ IID=i, quiet=quiet)
+ } else {
+ res[[i]] <- Map$Shapes[[i]]$verts
+ rD <- .ringDirxy(res[[i]])
+ if (rD != 1) {
+ res[[i]] <- res[[i]][nrow(res[[i]]):1,]
+ if (!quiet) warning(paste(
+ "Ring direction changed in shape", i))
+ }
+ attr(res[[i]], "pstart") <- list(from=as.integer(1),
+ to=as.integer(nrow(Map$Shapes[[i]]$verts)))
+# attr(Map$Shapes[[i]], "nVerts"))
+ attr(res[[i]], "after") <- 1
+ attr(res[[i]], "plotOrder") <- 1
+ attr(res[[i]], "bbox") <-
+ as.vector(attr(Map$Shapes[[i]], "bbox"))
+ attr(res[[i]], "RingDir") <-
+ as.vector(attr(Map$Shapes[[i]], "RingDir"))
+ attr(res[[i]], "nParts") <- nParts[i]
+ attr(res[[i]], "ringDir") <- .ringDirxy(res[[i]])
+ cents <- .RingCentrd_2d(res[[i]])
+ attr(res[[i]], "area") <- cents$area
+ attr(res[[i]], "centroid") <- list(x=cents$xc,
+ y=cents$yc)
+ }
+# attr(res[[i]], "shpID") <- attr(Map$Shapes[[i]], "shpID")
+ shpID <- attr(Map$Shapes[[i]], "shpID")
+ attr(res[[i]], "shpID") <- ifelse (is.null(shpID), as.integer(NA), shpID) }
+ if (is.null(region.id) || length(region.id) != n) {
+ attr(res, "region.id") <- as.character(1:n)
+ } else {
+ attr(res, "region.id") <- as.character(region.id)
+ }
+ class(res) <- "polylist"
+ invisible(res)
+}
+
+MapShapeIds <- function(Map) {
+ if (class(Map) != "Map") stop("not a Map")
+ sapply(Map$Shapes, function(x) attr(x, "shpID"))
+}
+.getMultiShp1 <- function(shp, nParts, IID, quiet=TRUE) {
+ Pstart <- shp$Pstart
+# nVerts <- attr(shp, "nVerts")
+ nVerts <- nrow(shp$verts)
+ from <- integer(nParts)
+ to <- integer(nParts)
+ area <- double(nParts)
+ xc <- double(nParts)
+ yc <- double(nParts)
+ from[1] <- 1
+ for (j in 1:nParts) {
+ if (j == nParts) to[j] <- nVerts
+ else {
+ to[j] <- Pstart[j+1]
+ from[j+1] <- to[j]+1
+ }
+ }
+ poly <- shp$verts[from[1]:to[1],]
+ rD <- .ringDirxy(poly)
+ if (rD != 1) {
+ poly <- poly[nrow(poly):1,]
+ if (!quiet) warning(paste(
+ "Ring direction changed in shape", IID, "ring 1"))
+ }
+ cents <- .RingCentrd_2d(poly)
+ area[1] <- cents$area
+ xc[1] <- cents$xc
+ yc[1] <- cents$yc
+ res <- poly
+ if (nParts > 1) {
+ for (j in 2:nParts) {
+ res <- rbind(res, c(NA, NA))
+ poly <- shp$verts[from[j]:to[j],]
+ rD <- .ringDirxy(poly)
+ if (rD != 1) {
+ poly <- poly[nrow(poly):1,]
+ if (!quiet) warning(paste(
+ "Ring direction changed in shape", IID, "ring", j))
+ }
+ cents <- .RingCentrd_2d(poly)
+ area[j] <- cents$area
+ xc[j] <- cents$xc
+ yc[j] <- cents$yc
+ res <- rbind(res, poly)
+ }
+ }
+ for (j in 1:nParts) {
+ from[j] <- from[j] + (j-1)
+ to[j] <- to[j] + (j-1)
+ }
+ attr(res, "nParts") <- nParts
+ attr(res, "pstart") <- list(from=as.integer(from), to=as.integer(to))
+ attr(res, "bbox") <- as.vector(attr(shp, "bbox"))
+ attr(res, "RingDir") <- as.vector(attr(shp, "RingDir"))
+ rD <- integer(nParts)
+ for (j in 1:nParts) rD[j] <- ringDir(res, j)
+ attr(res, "ringDir") <- rD
+ pO <- order(area, decreasing=TRUE)
+ after <- as.integer(rep(NA, nParts))
+ attr(res, "centroid") <- list(x=xc[pO[1]], y=yc[pO[1]])
+
+ attr(res, "after") <- after
+ attr(res, "plotOrder") <- pO
+ attr(res, "area") <- sum(area)
+
+ res
+}
+
+.getMultiShp <- function(shp, nParts, raw=TRUE) {
+ Pstart <- shp$Pstart
+# nVerts <- attr(shp, "nVerts")
+ nVerts <- nrow(shp$verts)
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ for (j in 1:nParts) {
+ if (j == nParts) to[j] <- nVerts
+ else {
+ to[j] <- Pstart[j+1]
+ from[j+1] <- to[j]+1
+ }
+ }
+ res <- shp$verts[from[1]:to[1],]
+ if (nParts > 1) {
+ for (j in 2:nParts) {
+ res <- rbind(res, c(NA, NA))
+ res <- rbind(res, shp$verts[from[j]:to[j],])
+ }
+ }
+ for (j in 1:nParts) {
+ from[j] <- from[j] + (j-1)
+ to[j] <- to[j] + (j-1)
+ }
+ attr(res, "nParts") <- nParts
+ attr(res, "pstart") <- list(from=as.integer(from), to=as.integer(to))
+ attr(res, "bbox") <- as.vector(attr(shp, "bbox"))
+ attr(res, "RingDir") <- as.vector(attr(shp, "RingDir"))
+ rD <- integer(nParts)
+ for (j in 1:nParts) rD[j] <- ringDir(res, j)
+ attr(res, "ringDir") <- rD
+ pO <- as.integer(1:nParts)
+ after <- as.integer(rep(NA, nParts))
+ res1 <- vector(mode="list", length=nParts)
+ for (i in 1:nParts) res1[[i]] <- res[from[i]:to[i],]
+ r1 <- .mtInsiders(res1, rD)
+ if (!all(sapply(r1, is.null))) {
+ lres <- .mtlbuild(.mtafters(r1), rD)
+ pO <- lres$pO
+ after <- lres$after
+ }
+# r1 <- .mtInsiders(res1)
+# if (!all(sapply(r1, is.null))) {
+# after <- as.integer(sapply(r1,
+# function(x) ifelse(is.null(x), NA, max(x))))
+# pO <- order(after, na.last=FALSE)
+# }
+
+ attr(res, "after") <- after
+ attr(res, "plotOrder") <- pO
+ if (!raw) {
+ top <- which(pO == 1)
+ if (any((rD[-top] == -1) & is.na(after[-top]))) {
+ oddCC <- which((rD == -1) & is.na(after))
+ for (i in oddCC) {
+ if (i != top) {
+# from1 <- from[i]
+# to1 <- to[i]
+ res[from[i]:to[i],] <- res[to[i]:from[i],]
+ attr(res, "ringDir")[i] <- ringDir(res, i)
+ warning(paste("ring direction changed in subpolygon"))
+ }
+ }
+ }
+
+
+ }
+ res
+}
+
+.get.polybbs <- function(Map) {
+ n <- length(Map$Shapes)
+ res <- matrix(0, ncol=4, nrow=n)
+ for (i in 1:n) res[i,] <- attr(Map$Shapes[[i]], "bbox")
+ res
+}
+
+Map2bbs <- function(Map) {
+ if (class(Map) != "Map") stop("not a Map")
+ if (attr(Map$Shapes,'shp.type') != 'poly')
+ stop("maptype not poly")
+ res <- .get.polybbs(Map)
+ res
+}
+
+Map2maplim <- function(Map) {
+ if (class(Map) != "Map") stop("not a Map")
+ mapxlim<-c(attr(Map$Shapes, 'minbb')[1],
+ attr(Map$Shapes, 'maxbb')[1])
+ mapylim<-c(attr(Map$Shapes, 'minbb')[2],
+ attr(Map$Shapes, 'maxbb')[2])
+ list(x=mapxlim, y=mapylim)
+}
+
+
+convert.pl <- function(pl) {
+ if (!inherits(pl, "multiparts")) stop("not a mulitpart polylist")
+ res <- vector(mode="list", length=length(pl))
+ for (i in 1:length(pl)) {
+ lp <- length(pl[[i]])
+ res[[i]] <- pl[[i]][[1]]
+ if (lp > 1) {
+ for (j in 2:lp) {
+ res[[i]] <- rbind(res[[i]], c(NA, NA))
+ res[[i]] <- rbind(res[[i]], pl[[i]][[j]])
+ }
+ }
+ }
+ if (!is.null(attr(pl, "region.id")))
+ attr(res, "region.id") <- attr(pl, "region.id")
+ class(res) <- "polylist"
+ res
+}
+
+.RingCentrd_2d <- function(plmat) {
+ nVert <- nrow(plmat)
+ res <- .C("RFindCG", as.integer(nVert), as.double(plmat[,1]),
+ as.double(plmat[,2]), as.double(0), as.double(0),
+ as.double(0), PACKAGE="maptools")
+
+# x_base <- plmat[1,1]
+# y_base <- plmat[1,2]
+# Cy_accum <- 0.0
+# Cx_accum <- 0.0
+# Area <- 0.0
+# ppx <- plmat[2,1] - x_base
+# ppy <- plmat[2,2] - y_base
+# for (iv in 2:(nVert-2)) {
+# x = plmat[iv,1] - x_base
+# y = plmat[iv,2] - y_base
+# dx_Area <- ((x * ppy) - (y * ppx)) * 0.5
+# Area <- Area + dx_Area
+# Cx_accum <- Cx_accum + ( ppx + x ) * dx_Area
+# Cy_accum <- Cy_accum + ( ppy + y ) * dx_Area
+# ppx <- x
+# ppy <- y
+# }
+# xc <- (Cx_accum / (Area * 3)) + x_base
+# yc <- (Cy_accum / (Area * 3)) + y_base
+ list(xc=res[[4]], yc=res[[5]], area=abs(res[[6]]))
+}
+
+.ringDirxy <- function(xy) {
+ a <- xy[,1]
+ b <- xy[,2]
+ nvx <- length(b)
+
+# if((a[1] == a[nvx]) && (b[1] == b[nvx])) {
+# a <- a[-nvx]
+# b <- b[-nvx]
+# nvx <- nvx - 1
+# }
+#
+# tX <- 0.0
+# dfYMax <- max(b)
+# ti <- 1
+# for (i in 1:nvx) {
+# if (b[i] == dfYMax && a[i] > tX) ti <- i
+# }
+# if ( (ti > 1) & (ti < nvx) ) {
+# dx0 = a[ti-1] - a[ti]
+# dx1 = a[ti+1] - a[ti]
+# dy0 = b[ti-1] - b[ti]
+# dy1 = b[ti+1] - b[ti]
+# } else if (ti == nvx) {
+# dx0 = a[ti-1] - a[ti]
+# dx1 = a[1] - a[ti]
+# dy0 = b[ti-1] - b[ti]
+# dy1 = b[1] - b[ti]
+# } else {
+# /* if the tested vertex is at the origin then continue from 0 (1) */
+# dx1 = a[2] - a[1]
+# dx0 = a[nvx] - a[1]
+# dy1 = b[2] - b[1]
+# dy0 = b[nvx] - b[1]
+# }
+# v3 = ( (dx0 * dy1) - (dx1 * dy0) )
+
+ res <- .C("RFindCG", as.integer(nvx), as.double(a), as.double(b),
+ as.double(0), as.double(0), as.double(0), PACKAGE="maptools")
+
+ if ( res[[6]] > 0 ) return(as.integer(-1))
+ else return(as.integer(1))
+}
+
diff --git a/R/maptoolsChanges.R b/R/maptoolsChanges.R
new file mode 100644
index 0000000..d7a5ee0
--- /dev/null
+++ b/R/maptoolsChanges.R
@@ -0,0 +1,19 @@
+maptools <- function(changes=FALSE) {
+ .DESC <- packageDescription("maptools")
+ cat(.DESC[["Package"]], ", version ", .DESC[["Version"]],
+ ", ", .DESC[["Date"]], "\n", sep="")
+ .CH <- NULL
+ if (changes) {
+ cat("\n")
+ file <- system.file("changes", package = "maptools")
+ .CH <- scan(file, list(version="character",
+ changes="character"), sep="\t", quiet=TRUE)
+ for (i in length(.CH$changes):1) {
+ cat(unlist(strsplit(.CH$changes[i], " ")), fill=TRUE,
+ labels=.CH$version[i])
+ cat("\n")
+ }
+ }
+ invisible(.CH)
+}
+
diff --git a/R/nowrapRecenter.R b/R/nowrapRecenter.R
new file mode 100644
index 0000000..977c4e3
--- /dev/null
+++ b/R/nowrapRecenter.R
@@ -0,0 +1,61 @@
+nowrapSpatialPolygons <- function(obj, offset=0, eps=rep(.Machine$double.eps, 2)) {
+ require(gpclib)
+ if (!is(obj, "SpatialPolygons")) stop("obj not a SpatialPolygons object")
+ proj <- is.projected(obj)
+ if (is.na(proj)) stop("unknown coordinate reference system")
+ if (proj) stop("cannot recenter projected coordinate reference system")
+ bblong <- bbox(obj)[1,]
+ inout <- bblong[1] < offset && bblong[2] >= offset
+ if (inout) {
+ pls <- slot(obj, "polygons")
+ Srl <- lapply(pls, .nowrapPolygons, offset=offset, eps=eps)
+ res <- as.SpatialPolygons.PolygonsList(Srl,
+ proj4string=CRS(proj4string(obj)))
+ } else res <- obj
+ res
+}
+
+.nowrapPolygons <- function(obj, offset=0, eps=rep(.Machine$double.eps, 2)) {
+ if (!is(obj, "Polygons")) stop("not an Polygons object")
+ bbo <- bbox(obj)
+ inout <- bbo[1,1] < offset && bbo[1,2] >= offset
+ if (inout) {
+ pls <- slot(obj, "Polygons")
+ nParts <- length(pls)
+# proj4CRS <- CRS(proj4string(obj))
+ ID <- slot(obj, "ID")
+ gpc <- as(slot(pls[[1]], "coords"), "gpc.poly")
+ if (nParts > 1) for (i in 2:nParts) gpc <- append.poly(gpc,
+ as(slot(pls[[i]], "coords"), "gpc.poly"))
+ bb <- get.bbox(gpc)
+ bbmat1 <- matrix(c(rep(bb$x[1], 2), rep(offset-eps[1], 2),
+ bb$x[1], bb$y[1], rep(bb$y[2], 2), rep(bb$y[1], 2)),
+ ncol=2)
+ bbmat2 <- matrix(c(rep(offset+eps[2], 2), rep(bb$x[2], 2),
+ offset+eps[2], bb$y[1], rep(bb$y[2], 2),
+ rep(bb$y[1], 2)), ncol=2)
+ gpc_left <- gpclib:::intersect(gpc, as(bbmat1, "gpc.poly"))
+ gpc_right <- gpclib:::intersect(gpc, as(bbmat2, "gpc.poly"))
+ gpc_res <- append.poly(gpc_left, gpc_right)
+ nP <- length(gpc_res at pts)
+ if (nP == 0)
+ return(obj)
+ Srl <- vector(mode="list", length=nP)
+ for (j in 1:nP) {
+ crds <- cbind(gpc_res at pts[[j]]$x, gpc_res at pts[[j]]$y)
+ crds <- rbind(crds, crds[1,])
+ hole <- gpc_res at pts[[j]]$hole
+ rD <- .ringDirxy(crds)
+ if (rD == 1 & hole) crds <- crds[nrow(crds):1,]
+ if (rD == -1 & !hole) crds <- crds[nrow(crds):1,]
+ Srl[[j]] <- Polygon(coords=crds, hole=hole)
+ }
+ res <- Polygons(Srl, ID=ID)
+ } else res <- obj
+ res
+}
+
+nowrapRecenter <- function(obj, offset=0, eps=rep(.Machine$double.eps, 2)) {
+ res <- recenter(nowrapSpatialPolygons(obj, offset=offset, eps=eps))
+ res
+}
diff --git a/R/pcent.R b/R/pcent.R
new file mode 100644
index 0000000..3c141de
--- /dev/null
+++ b/R/pcent.R
@@ -0,0 +1,21 @@
+# Copyright 2000-2001 (c) Nicholas Lewin-Koh
+# modifications 2001-2003 Roger Bivand
+
+
+get.Pcent <- function(theMap) {
+ .Deprecated("", package="maptools", msg="exrtact centroid from SpatialPolygons object;\nobjects other than Spatial objects defined in the sp package are deprecated")
+ p.cent <- function(poly, flag) {
+ cent <- .External("RshpCentrd_2d", poly, as.integer(flag),
+ PACKAGE="maptools")
+ cent
+ }
+ if (!inherits(theMap,"Map")) stop("not a Map object")
+ theShapes <- theMap$Shapes
+
+ if (attr(theShapes,'shp.type') != 'poly')
+ stop("Must be a valid polygon shapelist")
+
+ cent<-lapply(theShapes, p.cent, 0)
+ return(matrix(unlist(cent), ncol=2, byrow=TRUE))
+}
+
diff --git a/R/plot.Map.R b/R/plot.Map.R
new file mode 100644
index 0000000..9d51357
--- /dev/null
+++ b/R/plot.Map.R
@@ -0,0 +1,102 @@
+# Copyright 2000-2001 (c) Nicholas Lewin-Koh
+# modifications 2001-2004 Roger Bivand
+
+plot.Map <- function(x, recs, auxvar=NULL, add=FALSE, fg ='gray',
+ ol='black', prbg=NULL, glyph=16, color='red',
+ type='q', nclass=5, ...)
+{
+ .Deprecated("plot.Spatial", package="maptools")
+ theMap <- x
+ if(!inherits(theMap, "Map"))
+ stop("Map.obj must be of class Map")
+
+ if(missing(recs)) recs <- 1:attr(theMap$Shapes,'nshps')
+
+ if (length(fg) != length(recs)) fg <- rep(fg[1], length(recs))
+
+ xylims <- Map2maplim(theMap)
+
+ if(!add){
+ plot(xylims$x, xylims$y, asp=1, type='n',...)
+ }
+ if(!is.null(prbg)) {
+ plim <- par()$usr
+ rect(plim[1], plim[2], plim[3], plim[4], col=prbg) #,border=par()$bg)
+ }
+
+ ret <- NULL
+ if(attr(theMap$Shapes,'shp.type') == 'point' ) {
+ for(i in 1:length(recs)) {
+ points(theMap$Shapes[[recs[i]]]$verts, pch=glyph, col=fg[i])
+ }
+ }
+ if(attr(theMap$Shapes,'shp.type') == 'arc'){
+ for(i in 1:length(recs)) {
+ if(attr(theMap$Shapes[[recs[i]]], 'nParts') == 1) {
+ lines(theMap$Shapes[[recs[i]]]$verts, col=ol)
+ }
+ if(attr(theMap$Shapes[[recs[i]]], 'nParts') > 1){
+ for(j in 1:attr(theMap$Shapes[[recs[i]]], 'nParts')) {
+ if(j < attr(theMap$Shapes[[recs[i]]], 'nParts'))
+ lines(theMap$Shapes[[recs[i]]]$verts[j:(j+1)-1], col= ol)
+ else
+ lines(theMap$Shapes[[recs[i]]]$verts[j:attr(theMap$Shapes[[recs[i]]], 'nVerts')], col= ol)
+ }
+ }
+ }
+ }
+ if(attr(theMap$Shapes,'shp.type') == 'poly'){
+ if(!is.null(auxvar) && nclass > 1) {
+ if (length(auxvar) != attr(theMap$Shapes,'nshps'))
+ stop("lengths conflict")
+ col.rmp <- color.ramp(nclass, color=color, nvec=auxvar[recs], type=type)
+ for(i in 1:length(recs)) {
+ ii <- recs[i]
+ if(attr(theMap$Shapes[[ii]], 'nParts') == 1) {
+ polygon(theMap$Shapes[[ii]]$verts,
+ col=col.rmp$ramp[col.rmp$col.class[i]],
+ border= ol, ...)
+ }
+ if(attr(theMap$Shapes[[ii]], 'nParts') > 1) {
+ for(j in 1:attr(theMap$Shapes[[ii]], 'nParts')) {
+ if(j < attr(theMap$Shapes[[ii]], 'nParts')) {
+ polygon(theMap$Shapes[[ii]]$verts[(theMap$Shapes[[ii]]$Pstart[j]+1):
+ theMap$Shapes[[ii]]$Pstart[j+1],],
+ col=col.rmp$ramp[col.rmp$col.class[i]], border=ol, ...)
+ } else {
+ polygon(theMap$Shapes[[ii]]$verts[(theMap$Shapes[[ii]]$Pstart[j]+1):
+ attr(theMap$Shapes[[ii]],'nVerts'),],
+ col=col.rmp$ramp[col.rmp$col.class[i]],border= ol, ...)
+ }
+ }
+ }
+ }
+ ret <- col.rmp
+ } else {
+ for(i in 1:length(recs)) {
+ ii <- recs[i]
+ if(attr(theMap$Shapes[[ii]],'nParts') == 1) {
+ polygon(theMap$Shapes[[ii]]$verts, col=fg[i], border= ol, ...)
+ }
+ if(attr(theMap$Shapes[[ii]],'nParts') > 1) {
+ for(j in 1:attr(theMap$Shapes[[ii]], 'nParts')) {
+ if(j<attr(theMap$Shapes[[ii]], 'nParts')) {
+ polygon(theMap$Shapes[[ii]]$verts[(theMap$Shapes[[ii]]$Pstart[j]+1):
+ theMap$Shapes[[ii]]$Pstart[j+1],], col=fg[i] ,border= ol, ...)
+ } else {
+ polygon(theMap$Shapes[[ii]]$verts[(theMap$Shapes[[ii]]$Pstart[j]+1):
+ attr(theMap$Shapes[[ii]],'nVerts'),],
+ col=fg[i], border=ol, ...)
+ }
+ }
+ }
+ }
+ }
+ }
+ if(attr(theMap$Shapes,'shp.type')=='multipoint'){
+ stop("Multipoint shape type not yet plotted")
+ }
+ invisible(ret)
+}
+
+
diff --git a/R/point.in.polygon.R b/R/point.in.polygon.R
new file mode 100644
index 0000000..f68bc3d
--- /dev/null
+++ b/R/point.in.polygon.R
@@ -0,0 +1,12 @@
+# Copyright 2004 Edzer Pebesma (copied from sp package)
+
+"mt.point.in.polygon" <-
+function(point.x, point.y, pol.x, pol.y) {
+ .Call("R_point_in_polygon_mt",
+ as.numeric(point.x),
+ as.numeric(point.y),
+ as.numeric(pol.x),
+ as.numeric(pol.y)
+ , PACKAGE = "maptools"
+ )
+}
diff --git a/R/pointLabel.R b/R/pointLabel.R
new file mode 100644
index 0000000..c7602c2
--- /dev/null
+++ b/R/pointLabel.R
@@ -0,0 +1,218 @@
+pointLabel <- function(x, y = NULL, labels = seq(along = x), cex = 1,
+ method = c("SANN", "GA"),
+ allowSmallOverlap = FALSE,
+ trace = FALSE,
+ doPlot = TRUE,
+ ...)
+{
+ if (!missing(y) && (is.character(y) || is.expression(y))) {
+ labels <- y
+ y <- NULL
+ }
+ labels <- as.graphicsAnnot(labels)
+ boundary <- par()$usr
+ xyAspect <- par()$pin[1] / par()$pin[2] # width / height
+ # scale to a unit area from 0 to 1
+ toUnityCoords <- function(xy) {
+ list(x = (xy$x - boundary[1]) / (boundary[2] - boundary[1]) * xyAspect,
+ y = (xy$y - boundary[3]) / (boundary[4] - boundary[3]) / xyAspect)
+ }
+ toUserCoords <- function(xy) {
+ list(x = boundary[1] + xy$x / xyAspect * (boundary[2] - boundary[1]),
+ y = boundary[3] + xy$y * xyAspect * (boundary[4] - boundary[3]))
+ }
+ z <- xy.coords(x, y, recycle = TRUE)
+ z <- toUnityCoords(z)
+ x <- z$x
+ y <- z$y
+ if (length(labels) < length(x))
+ labels <- rep(labels, length(x))
+ method <- match.arg(method)
+
+ if (allowSmallOverlap)
+ nudgeFactor <- 0.02
+ n_labels <- length(x)
+ # There are eight possible alignment codes, corresponding to the
+ # corners and side mid-points of the rectangle
+ # Codes are 1:8
+ # Code 7 (top right) is the most preferred
+ width <- (strwidth(labels, units = "figure", cex = cex) + 0.015) * xyAspect
+ height <- (strheight(labels, units = "figure", cex = cex) + 0.015) / xyAspect
+
+ gen_offset <- function(code)
+ c(-1, -1, -1, 0, 0, 1, 1, 1)[code] * (width/2) +
+ 1i * c(-1, 0, 1, -1, 1, -1, 0, 1)[code] * (height/2)
+
+
+ # Finds intersection area of two rectangles
+ rect_intersect <- function(xy1, offset1, xy2, offset2) {
+ w <- pmin(Re(xy1+offset1/2), Re(xy2+offset2/2)) - pmax(Re(xy1-offset1/2), Re(xy2-offset2/2))
+ h <- pmin(Im(xy1+offset1/2), Im(xy2+offset2/2)) - pmax(Im(xy1-offset1/2), Im(xy2-offset2/2))
+ w[w <= 0] <- 0
+ h[h <= 0] <- 0
+ w*h
+ }
+
+ nudge <- function(offset) {
+ # Nudge the labels slightly if they overlap:
+ doesIntersect <- rect_intersect(xy[rectidx1] + offset[rectidx1], rectv[rectidx1],
+ xy[rectidx2] + offset[rectidx2], rectv[rectidx2]) > 0
+
+ pyth <- abs(xy[rectidx1] + offset[rectidx1] - xy[rectidx2] - offset[rectidx2]) / nudgeFactor
+ eps <- 1.0e-10
+
+ for (i in which(doesIntersect & pyth > eps)) {
+ idx1 <- rectidx1[i]
+ idx2 <- rectidx2[i]
+ vect <- (xy[idx1] + offset[idx1] - xy[idx2] - offset[idx2]) / pyth[idx1]
+ offset[idx1] <- offset[idx1] + vect
+ offset[idx2] <- offset[idx2] - vect
+ }
+ offset
+ }
+
+ objective <- function(gene) {
+ offset <- gen_offset(gene)
+
+ # Allow for "bending" the labels a bit
+ if (allowSmallOverlap) offset <- nudge(offset)
+
+ if (!is.null(rectidx1))
+ area <- sum(rect_intersect(xy[rectidx1] + offset[rectidx1], rectv[rectidx1],
+ xy[rectidx2] + offset[rectidx2], rectv[rectidx2]))
+ else
+ area <- 0
+
+ # Penalize labels which go outside the image area
+ # Count points outside of the image
+ n_outside <- sum(Re(xy + offset - rectv/2) < 0 | Re(xy + offset + rectv/2) > xyAspect |
+ Im(xy + offset - rectv/2) < 0 | Im(xy + offset + rectv/2) > 1/xyAspect)
+ res <- 1000 * area + n_outside
+ #cat(n_outside,"\n")
+ res
+ }
+
+ # Make a list of label rectangles in their reference positions,
+ # centered over the map feature; the real labels are displaced
+ # from these positions so as not to overlap
+ # Note that some labels can be bigger than others
+ xy <- x + 1i * y
+ rectv <- width + 1i * height
+
+ rectidx1 <- rectidx2 <- array(0, (length(x)^2 - length(x)) / 2)
+ k <- 0
+ for (i in 1:length(x))
+ for (j in seq(len=(i-1))) {
+ k <- k + 1
+ rectidx1[k] <- i
+ rectidx2[k] <- j
+ }
+ canIntersect <- rect_intersect(xy[rectidx1], 2 * rectv[rectidx1],
+ xy[rectidx2], 2 * rectv[rectidx2]) > 0
+ rectidx1 <- rectidx1[canIntersect]
+ rectidx2 <- rectidx2[canIntersect]
+ if (trace) cat("possible intersects =", length(rectidx1), "\n")
+
+ if (trace) cat("portion covered =", sum(rect_intersect(xy, rectv,xy,rectv)),"\n")
+
+ GA <- function() {
+ # Make some starting genes
+ n_startgenes <- 1000 # size of starting gene pool
+ n_bestgenes <- 30 # genes selected for cross-breeding
+ prob <- 0.2
+
+ # Mutation function: O(n^2) time
+ mutate <- function(gene) {
+ offset <- gen_offset(gene)
+ # Directed mutation where two rectangles intersect
+ doesIntersect <- rect_intersect(xy[rectidx1] + offset[rectidx1], rectv[rectidx1],
+ xy[rectidx2] + offset[rectidx2], rectv[rectidx2]) > 0
+
+ for (i in which(doesIntersect)) {
+ gene[rectidx1[i]] <- sample(1:8, 1)
+ }
+ # And a bit of random mutation, too
+ for (i in seq(along=gene))
+ if (runif(1) <= prob)
+ gene[i] <- sample(1:8, 1)
+ gene
+ }
+
+ # Crossbreed two genes, then mutate at "hot spots" where intersections remain
+ crossbreed <- function(g1, g2)
+ ifelse(sample(c(0,1), length(g1), repl = TRUE) > .5, g1, g2)
+
+
+ genes <- matrix(sample(1:8, n_labels * n_startgenes, repl = TRUE), n_startgenes, n_labels)
+
+ for (i in 1:10) {
+ scores <- array(0., NROW(genes))
+ for (j in 1:NROW(genes))
+ scores[j] <- objective(genes[j,])
+ rankings <- order(scores)
+ genes <- genes[rankings,]
+ bestgenes <- genes[1:n_bestgenes,]
+ bestscore <- scores[rankings][1]
+ if (bestscore == 0) {
+ if (trace) cat("overlap area =", bestscore, "\n")
+ break
+ }
+ # At each stage, we breed the best genes with one another
+ genes <- matrix(0, n_bestgenes^2, n_labels)
+ for (j in 1:n_bestgenes)
+ for (k in 1:n_bestgenes)
+ genes[n_bestgenes*(j-1) + k,] <- mutate(crossbreed(bestgenes[j,], bestgenes[k,]))
+
+ genes <- rbind(bestgenes, genes)
+ if (trace) cat("overlap area =", bestscore, "\n")
+ }
+ nx <- Re(xy + gen_offset(bestgenes[1,]))
+ ny <- Im(xy + gen_offset(bestgenes[1,]))
+ list(x = nx, y = ny)
+ }
+ SANN <- function() {
+ # Make some starting "genes"
+ #gene <- sample(1:8, n_labels, repl = TRUE)
+ gene <- rep(8, n_labels)
+ score <- objective(gene)
+ bestgene <- gene
+ bestscore <- score
+ T <- 2.5
+ for (i in 1:50) {
+ k <- 1
+ for (j in 1:50) {
+ newgene <- gene
+ newgene[sample(1:n_labels, 1)] <- sample(1:8,1)
+ newscore <- objective(newgene)
+ if (newscore <= score || runif(1) < exp((score - newscore) / T)) {
+ # keep the new set if it has the same or better score or
+ # if it's worse randomly based on the annealing criteria
+ k <- k + 1
+ score <- newscore
+ gene <- newgene
+ }
+ if (score <= bestscore) {
+ bestscore <- score
+ bestgene <- gene
+ }
+ if (bestscore == 0 || k == 10) break
+ }
+ if (bestscore == 0) break
+ if (trace) cat("overlap area =", bestscore, "\n")
+ T <- 0.9 * T
+ }
+
+ if (trace) cat("overlap area =", bestscore, "\n")
+ nx <- Re(xy + gen_offset(bestgene))
+ ny <- Im(xy + gen_offset(bestgene))
+ list(x = nx, y = ny)
+ }
+ if (method == "SANN")
+ xy <- SANN()
+ else
+ xy <- GA()
+ xy <- toUserCoords(xy)
+ if (doPlot)
+ text(xy, labels, cex = cex, ...)
+ invisible(xy)
+}
diff --git a/R/readGPS.R b/R/readGPS.R
new file mode 100644
index 0000000..a9e5f91
--- /dev/null
+++ b/R/readGPS.R
@@ -0,0 +1,17 @@
+# Copyright (c) 2007 Patrick Giraudoux and Roger Bivand
+
+readGPS <- function(i="garmin", f="usb:", type="w", invisible=TRUE, ...) {
+ GB <- Sys.which("gpsbabel")
+ if (nchar(GB) == 0) stop("gpsbabel not found")
+ if (.Platform$OS.type == "windows")
+ gpsdata <- system(paste(GB, " -", type, " -i ", i, " -f ", f,
+ " -o tabsep -F -", sep=""), intern=TRUE, invisible=invisible)
+ else gpsdata <- system(paste(GB, " -", type, " -i ", i, " -f ", f,
+ " -o tabsep -F -", sep=""), intern=TRUE)
+ if (any(grep("Can't init", gpsdata)))
+ stop("Cannot read GPS: check connexion")
+ gpsdf <- read.table(con <- textConnection(gpsdata), fill=TRUE, ...)
+ close(con)
+ gpsdf
+}
+
diff --git a/R/readSplus.R b/R/readSplus.R
new file mode 100644
index 0000000..c8bde57
--- /dev/null
+++ b/R/readSplus.R
@@ -0,0 +1,85 @@
+#
+#Read maps in S-plus format (as exported by WinBUGS)
+#
+readSplus<-function(file, proj4string=CRS(as.character(NA)) )
+{
+
+ lns<-readLines(file)
+ nlines<-length(lns)
+ nareas<-as.integer(strsplit(lns[1], ":")[[1]][2])
+
+ offset<-1
+ if(lns[2]==""){offset<-offset+1}
+
+ xscale <- 1
+ yscale <- 1
+ scales <- grep("cale", lns[(offset+1):(offset+2)])
+ if (length(scales) > 0) {
+ if (length(scales) < 2)
+ stop("Only one scale given")
+ xsc <- grep("x|X", lns[(offset+1):(offset+2)])
+ ysc <- grep("y|Y", lns[(offset+1):(offset+2)])
+ xscale <- strsplit(lns[(offset+xsc)], ":| |\t|\r\n")[[1]]
+ if (any(xscale == "")) xscale <- xscale[-which(xscale == "")]
+ xscale <- as.numeric(xscale[2])
+ yscale <- strsplit(lns[(offset+xsc)], ":| |\t|\r\n")[[1]]
+ if (any(yscale == "")) yscale <- yscale[-which(yscale == "")]
+ yscale <- as.numeric(yscale[2])
+ offset <- offset+2
+ if(lns[(offset+1)]==""){offset<-offset+1}
+ }
+
+ IDs<-lapply(lns[offset+1:nareas], function(X){strsplit(X, " |\t|\r\n")})
+ IDs<-matrix(unlist(IDs), ncol=2, byrow=TRUE)
+
+ offset<-offset+nareas
+
+ if(lns[offset+1]==""){offset<-offset+1}
+
+ END <- which(lns == "END")
+ lns <- lns[(offset+1):(END-1)]
+ if (any(lns == "")) {
+ empty <- which(lns == "")
+ lns <- lns[-empty]
+ }
+
+# polys<-read.table(file, skip=offset, nrows=nlines-offset-END)
+ polys <- lapply(lns, function(X){strsplit(X, " |\t|\r\n")})
+ polys <- matrix(unlist(polys), ncol=3, byrow=TRUE)
+ wNA <- which(polys[,1] == "NA")
+ is.na(polys[wNA,1]) <- TRUE
+ is.na(polys[wNA,2]) <- TRUE
+ is.na(polys[wNA,3]) <- TRUE
+
+ polys2<-cbind(xscale*as.numeric(polys[,2]),
+ yscale*as.numeric(polys[,3]))
+
+ lpolys<-.NAmat2xyList(polys2)
+# llpolys<-unlist(lapply(lpolys, nrow))
+
+# idx<- c(1, cumsum(2+llpolys[-length(lpolys)]))
+ wNA <- which(is.na(polys[, 1]))
+ idx <- c(1, wNA+1)
+ polysIDs<-polys[idx, 1]
+
+ belongs<-lapply(1:nareas, function(i){which(polysIDs==IDs[i,2])})
+
+ Srl <- vector(mode = "list", length = nareas)
+
+ for (i in 1:nareas) {
+ nParts <- length(belongs[[i]])
+ srl <- vector(mode = "list", length = nParts)
+ for (j in 1:nParts) {
+ crds <- lpolys[[belongs[[i]][j]]]
+ nc <- nrow(crds)
+ if (crds[1,1] != crds[nc,1] || crds[1,2] != crds[nc,2])
+ crds <- rbind(crds, crds[1,,drop=FALSE])
+ srl[[j]] <- Polygon(coords = crds)
+ }
+ Srl[[i]] <- Polygons(srl, ID = IDs[i,2])
+ }
+
+ res <- as.SpatialPolygons.PolygonsList(Srl, proj4string = proj4string)
+ res
+}
+
diff --git a/R/shapelib.R b/R/shapelib.R
new file mode 100644
index 0000000..d837ce5
--- /dev/null
+++ b/R/shapelib.R
@@ -0,0 +1,338 @@
+# Copyright 2000-2001 (c) Nicholas Lewin-Koh
+# modifications 2001-2008 Roger Bivand
+# reads an ESRI shapefile into a map object
+# set the variables for the header info
+
+
+read.shape <- function(filen, dbf.data=TRUE, verbose=TRUE, repair=FALSE) {
+ filen <- path.expand(filen)
+ .Deprecated("", package="maptools", msg="use readShapeSpatial:\nobjects other than Spatial objects defined in the sp package are deprecated")
+ shinfo <- getinfo.shape(filen)
+ if (dbf.data) {
+# library(foreign)
+ df <- read.dbf(filen)
+ ndf <- as.integer(nrow(df))
+ } else ndf <- as.integer(NA)
+ if (shinfo[[2]] == 8) {
+ if (!dbf.data) stop("to test for multipoint compliance, set dbf.data=TRUE")
+ if (ndf != shinfo[[3]]) stop("noncompliant multipoint shapefile")
+ }
+ shp.lst <- .Call("Rshapeget", as.character(filen), as.logical(repair),
+ PACKAGE="maptools")
+ if (verbose) {
+ print(shinfo)
+ }
+ n <- length(shp.lst)
+ for (i in 1:n) {
+ attr(shp.lst[[i]], "nVerts") <- as.integer(shp.lst[[i]]$nVerts)
+ attr(shp.lst[[i]], "nParts") <- as.integer(shp.lst[[i]]$nParts)
+ attr(shp.lst[[i]], "shp.type") <- as.integer(shp.lst[[i]]$shp.type)
+ attr(shp.lst[[i]], "bbox") <- as.double(shp.lst[[i]]$bbox)
+ }
+ class(shp.lst) <- "ShapeList"
+ if (dbf.data) {
+ map <- list(Shapes=shp.lst, att.data=df)
+ class(map) <- "Map"
+ return(map)
+ }
+ else {
+ return(shp.lst)
+ }
+}
+
+getinfo.shape <- function(filen) {
+ shapehead <-.Call("Rshapeinfo1", as.character(path.expand(filen)), PACKAGE="maptools")
+ class(shapehead) <- "shapehead"
+ shapehead
+}
+
+print.shapehead <- function(x, ...) {
+ types <- c("Point", NA, "PolyLine", NA, "Polygon", NA, NA, "MultiPoint", NA, NA, "PointZ", NA, "PolyLineZ", NA, "PolygonZ", NA, NA, "MultiPointZ", NA, NA, "PointM", NA, "PolyLineM", NA, "PolygonM", NA, NA, "MultiPointM", NA, NA, "MultiPatch")
+ cat("Shapefile type: ", types[x[[2]]], ", (", x[[2]], "), # of Shapes: ",
+ x[[3]], "\n", sep="")
+}
+
+
+#write.pointShape <- function(object, file, coordinates, factor2char=TRUE,
+write.pointShape <- function(coordinates, df, file, factor2char=TRUE,
+ strictFilename=FALSE, max_nchar=254) {
+ .Deprecated("", package="maptools", msg="use writeSpatialShape:\nobjects other than Spatial objects defined in the sp package are deprecated")
+ file <- path.expand(file)
+ dirnm <- dirname(file)
+ bnm0 <- basename(file)
+ bnm1 <- strsplit(bnm0, "\\.")[[1]]
+ if (bnm1[length(bnm1)] == "shp")
+ bnm <- paste(bnm1[-length(bnm1)], collapse=".")
+ else bnm <- bnm0
+ file <- paste(dirnm, bnm, sep=.Platform$file.sep)
+ if (strictFilename && nchar(basename(file)) > 8)
+ stop("shapefile names must conform to the 8.3 format")
+ if (!is.matrix(coordinates)) stop("coordinates must be a matrix")
+ if (!is.numeric(coordinates)) stop("coordinates must be numeric")
+ ncolcrds <- ncol(coordinates)
+ if (ncolcrds < 2) stop("coordinates must have at least 2 columns")
+ if (ncolcrds > 3) stop("coordinates must have 2 or 3 columns")
+ if (nrow(df) != nrow(coordinates))
+ stop("different number of rows in coordinates and data frame")
+# library(foreign)
+ write.dbf(df, paste(file, ".dbf", sep=""), factor2char=factor2char, max_nchar=max_nchar)
+ res <- .Call("shpwritepoint", as.character(file), as.double(coordinates),
+ as.integer(ncolcrds), PACKAGE="maptools")
+ invisible(res)
+}
+
+.isValidPolylist <- function(polylist, verbose=FALSE) {
+ if (!inherits(polylist, "polylist")) stop("not a polylist object")
+ res <- TRUE
+ if (length(polylist) < 1) {
+ if (verbose) cat("zero length polylist\n")
+ res <- FALSE
+ }
+ if (is.null(attr(polylist, "nDims"))) {
+ if (verbose) cat("null polylist nDims attribute\n")
+ res <- FALSE
+ } else {
+ if (attr(polylist, "nDims") < 2 || attr(polylist, "nDims") > 3) {
+ if (verbose) cat("polylist nDims attribute neither 2 nor 3\n")
+ res <- FALSE
+ }
+ if (!is.integer(attr(polylist, "nDims"))) {
+ if (verbose) cat("nDims not all integer\n")
+ res <- FALSE
+ }
+ }
+ if (!all(sapply(polylist, function(x) is.double(x)))) {
+ if (verbose) cat("coordinates not all double\n")
+ res <- FALSE
+ }
+ if (any(sapply(polylist, function(x) is.null(attr(x, "nParts"))))) {
+ if (verbose) cat("null polylist nParts attribute\n")
+ res <- FALSE
+ } else {
+ if (any(sapply(polylist, function(x) attr(x, "nParts") < 1))) {
+ if (verbose) cat("polylist nParts attribute less than 1\n")
+ res <- FALSE
+ }
+ if (!all(sapply(polylist, function(x) is.integer(attr(x, "nParts"))))) {
+ if (verbose) cat("nParts not all integer\n")
+ res <- FALSE
+ }
+ }
+ if (any(sapply(polylist, function(x) is.null(attr(x, "pstart"))))) {
+ if (verbose) cat("null polylist pstart attribute\n")
+ res <- FALSE
+ } else {
+ if (any(sapply(polylist, function(x) is.null(attr(x, "pstart")$from)))) {
+ if (verbose) cat("null polylist pstart$from attribute\n")
+ res <- FALSE
+ } else {
+ if (!all(sapply(polylist, function(x) is.integer(attr(x,
+ "pstart")$from)))) {
+ if (verbose) cat("pstart$from not all integer\n")
+ res <- FALSE
+ }
+ }
+ if (any(sapply(polylist, function(x) is.null(attr(x, "pstart")$to)))) {
+ if (verbose) cat("null polylist pstart$to attribute\n")
+ res <- FALSE
+ } else {
+ if (!all(sapply(polylist, function(x) is.integer(attr(x,
+ "pstart")$to)))) {
+ if (verbose) cat("pstart$to not all integer\n")
+ res <- FALSE
+ }
+ }
+ }
+ res
+}
+
+.makePolylistValid <- function(polylist) {
+ if (!inherits(polylist, "polylist")) stop("not a polylist object")
+ if (length(polylist) < 1) stop("zero length polylist")
+ n <- length(polylist)
+ if (is.null(attr(polylist, "nDims")) ||
+ !is.integer(attr(polylist, "nDims")) ||
+ (attr(polylist, "nDims") < 2 || attr(polylist, "nDims") > 3)) {
+ nD <- unique(sapply(polylist, function(x) dim(x)[2]))
+ if (length(nD) > 1) stop("multiple dimension polylist components")
+ nD <- as.integer(nD)
+ attr(polylist, "nDims") <- nD
+ }
+ if (!all(sapply(polylist, function(x) is.double(x)))) {
+ for (i in 1:n) {
+ a <- attributes(polylist[[i]])
+ polylist[[i]] <- matrix(as.double(polylist[[i]]), ncol=nD)
+ attributes(polylist[[i]]) <- a
+ }
+ warning("coordinates changed to double")
+ }
+ if (any(sapply(polylist, function(x) is.null(attr(x, "nParts"))))) {
+ for (i in 1:n) {
+ if (any(is.na(c(polylist[[i]])))) {
+ xy <- polylist[[i]]
+ NAs <- unclass(attr(na.omit(xy), "na.action"))
+ nParts <- length(NAs) + 1
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ to[nParts] <- nrow(xy)
+ if (nParts > 1) {
+ for (j in 2:nParts) {
+ to[(j-1)] <- NAs[(j-1)]-1
+ from[j] <- NAs[(j-1)]+1
+ }
+ }
+ attr(polylist[[i]], "nParts") <- as.integer(nParts)
+ a <- list()
+ a$from <- as.integer(from)
+ a$to <- as.integer(to)
+ attr(polylist[[i]], "pstart") <- a
+ } else {
+ attr(polylist[[i]], "nParts") <- as.integer(1)
+ a <- list()
+ a$from <- as.integer(1)
+ a$to <- as.integer(nrow(polylist[[i]]))
+ attr(polylist[[i]], "pstart") <- a
+ }
+ attr(polylist[[i]], "ringDir") <- as.integer(rep(1,
+ attr(polylist[[i]], "nParts")))
+ attr(polylist[[i]], "plotOrder") <-
+ as.integer(1:attr(polylist[[i]], "nParts"))
+ }
+ warning("nParts and pstart added")
+ }
+ if (any(sapply(polylist, function(x) attr(x, "nParts") < 1)))
+ stop("polylist nParts attribute less than 1")
+ if (!all(sapply(polylist, function(x) is.integer(attr(x, "nParts"))))) {
+ for (i in 1:n) attr(polylist[[i]], "nParts") <-
+ as.integer(attr(polylist[[i]], "nParts"))
+ warning("nParts changed to integer")
+ }
+ if (any(sapply(polylist, function(x) is.null(attr(x, "pstart"))))) {
+ for (i in 1:n) {
+ if (any(is.na(c(polylist[[i]])))) {
+ xy <- polylist[[i]]
+ NAs <- unclass(attr(na.omit(xy), "na.action"))
+ nParts <- length(NAs) + 1
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ to[nParts] <- nrow(xy)
+ if (nParts > 1) {
+ for (j in 2:nParts) {
+ to[(j-1)] <- NAs[(j-1)]-1
+ from[j] <- NAs[(j-1)]+1
+ }
+ }
+ attr(polylist[[i]], "nParts") <- as.integer(nParts)
+ a <- list()
+ a$from <- as.integer(from)
+ a$to <- as.integer(to)
+ attr(polylist[[i]], "pstart") <- a
+ } else {
+ attr(polylist[[i]], "nParts") <- as.integer(1)
+ a <- list()
+ a$from <- as.integer(1)
+ a$to <- as.integer(nrow(polylist[[i]]))
+ attr(polylist[[i]], "pstart") <- a
+ }
+ attr(polylist[[i]], "ringDir") <- as.integer(rep(1,
+ attr(polylist[[i]], "nParts")))
+ attr(polylist[[i]], "plotOrder") <-
+ as.integer(1:attr(polylist[[i]], "nParts"))
+ }
+ warning("nParts and pstart added")
+ }
+ if (!all(sapply(polylist, function(x) is.integer(attr(x, "pstart")$from)))) {
+ for (i in 1:n) attr(polylist[[i]], "pstart")$from <-
+ as.integer(attr(polylist[[i]], "pstart")$from)
+ warning("pstart$from changed to integer")
+ }
+ if (!all(sapply(polylist, function(x) is.integer(attr(x, "pstart")$to)))) {
+ for (i in 1:n) attr(polylist[[i]], "pstart")$to <-
+ as.integer(attr(polylist[[i]], "pstart")$to)
+ warning("pstart$to changed to integer")
+ }
+ polylist
+}
+
+write.polylistShape <- function(polylist, df, file, factor2char=TRUE,
+ strictFilename=FALSE, force=TRUE, max_nchar=254) {
+ .Deprecated("", package="maptools", msg="use writeSpatialShape:\nobjects other than Spatial objects defined in the sp package are deprecated")
+ file <- path.expand(file)
+ dirnm <- dirname(file)
+ bnm0 <- basename(file)
+ bnm1 <- strsplit(bnm0, "\\.")[[1]]
+ if (bnm1[length(bnm1)] == "shp")
+ bnm <- paste(bnm1[-length(bnm1)], collapse=".")
+ else bnm <- bnm0
+ file <- paste(dirnm, bnm, sep=.Platform$file.sep)
+ if (strictFilename && nchar(basename(file)) > 8)
+ stop("shapefile names must conform to the 8.3 format")
+ if (!inherits(polylist, "polylist")) stop("not a polylist object")
+ if (length(polylist) < 1) stop("zero length polylist")
+ if (nrow(df) != length(polylist))
+ stop("different number of rows in polylist and data frame")
+ if (!.isValidPolylist(polylist)) {
+ if (!force)
+ stop("Invalid polylist - set force=TRUE to coerce to validity")
+ else polylist <- .makePolylistValid(polylist)
+ }
+# library(foreign)
+ write.dbf(df, paste(file, ".dbf", sep=""), factor2char=factor2char, max_nchar=max_nchar)
+ res <- .Call("shpwritepolys", as.character(file), polylist,
+ PACKAGE="maptools")
+ invisible(res)
+}
+
+write.linelistShape <- function(linelist, df, file, factor2char=TRUE,
+ strictFilename=FALSE, max_nchar=254) {
+ .Deprecated("", package="maptools", msg="use writeSpatialShape:\nobjects other than Spatial objects defined in the sp package are deprecated")
+ file <- path.expand(file)
+ dirnm <- dirname(file)
+ bnm0 <- basename(file)
+ bnm1 <- strsplit(bnm0, "\\.")[[1]]
+ if (bnm1[length(bnm1)] == "shp")
+ bnm <- paste(bnm1[-length(bnm1)], collapse=".")
+ else bnm <- bnm0
+ file <- paste(dirnm, bnm, sep=.Platform$file.sep)
+ if (strictFilename && nchar(basename(file)) > 8)
+ stop("shapefile names must conform to the 8.3 format")
+ if (length(linelist) < 1) stop("zero length linelist")
+ if (nrow(df) != length(linelist))
+ stop("different number of rows in linelist and data frame")
+ if (!any(sapply(linelist, function(x) is.integer(attr(x, "nParts"))))) {
+ for (i in 1:length(linelist)) {
+ attr(linelist[[i]], "nParts") <- as.integer(attr(linelist[[i]], "nParts"))
+ }
+ warning("nParts changed to integer")
+ }
+ if (!any(sapply(linelist, function(x) is.integer(attr(x, "pstart")[[1]])))) {
+ for (i in 1:length(linelist)) {
+ attr(linelist[[i]], "pstart")[[1]] <- as.integer(attr(linelist[[i]],
+ "pstart")[[1]])
+ }
+ warning("pstart changed to integer")
+ }
+ if (!any(sapply(linelist, function(x) is.integer(attr(x, "pstart")[[2]])))) {
+ for (i in 1:length(linelist)) {
+ attr(linelist[[i]], "pstart")[[2]] <- as.integer(attr(linelist[[i]],
+ "pstart")[[2]])
+ }
+ warning("pstart changed to integer")
+ }
+# if (!all(sapply(linelist, function(x) all(!is.na(x)))))
+# stop("NAs in line coordinate data")
+ if (!any(sapply(linelist, function(x) is.double(x)))) {
+ for (i in 1:length(linelist)) {
+ linelist[[i]] <- matrix(as.double(linelist[[i]]), ncol=2)
+ }
+ warning("coordinates changed to double")
+ }
+# library(foreign)
+ write.dbf(df, paste(file, ".dbf", sep=""), factor2char=factor2char, max_nchar=max_nchar)
+ res <- .Call("shpwritelines", as.character(file), linelist,
+ PACKAGE="maptools")
+ invisible(res)
+}
+
diff --git a/R/sp2Mondrian.R b/R/sp2Mondrian.R
new file mode 100644
index 0000000..a51126b
--- /dev/null
+++ b/R/sp2Mondrian.R
@@ -0,0 +1,124 @@
+# Copyright (c) 2006-7 Patrick Hausmann and Roger Bivand
+
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+sp2Mondrian <- function(SP, file, new_format=TRUE) {
+ if (!inherits(SP, "SpatialPolygonsDataFrame"))
+ stop("not a SpatialPolygonsDataFrame object")
+ pls <- slot(SP, "polygons")
+ n <- length(pls)
+ id <- 1:n
+ df <- as(SP, "data.frame")
+ df <- data.frame("/P_SP_ID"=id, df, check.names=FALSE)
+
+ if (!new_format) {
+ con <- file(file, open="wt")
+ write.table(df, file = con,
+ quote = FALSE,
+ row.names = FALSE,
+ col.names = TRUE, sep="\t", dec=".")
+ IDs <- sapply(pls, function(x) slot(x, "ID"))
+ for (i in 1:n) {
+ pl <- slot(pls[[i]], "Polygons")
+ m <- length(pl)
+ for (j in 1:m) {
+ crds <- slot(pl[[j]], "coords")
+ nc <- nrow(crds)
+ lab <- paste(id[i], paste("/P", IDs[i], sep=""),
+ nc, sep="\t")
+ cat("\n", file = con)
+ writeLines(lab, con = con)
+ write.table(crds, file = con,
+ append = TRUE,
+ row.names = FALSE,
+ col.names = FALSE, sep="\t", dec=".")
+ }
+
+ }
+ close(con)
+ } else {
+ bnm <- basename(file)
+ dnm <- dirname(file)
+ MAP_file <- paste(dnm, paste("MAP_", bnm, sep=""),
+ sep=.Platform$file.sep)
+
+ con <- file(file, open="wt")
+ write.table(df, file = con,
+ quote = FALSE,
+ row.names = FALSE,
+ col.names = TRUE, sep="\t", dec=".")
+
+ cat("\n", file = con)
+ writeLines(MAP_file, con, sep="")
+
+ close(con)
+ con <- file(MAP_file, open="wt")
+ for (i in 1:n) {
+ pl <- slot(pls[[i]], "Polygons")
+ m <- length(pl)
+ for (j in 1:m) {
+ crds <- slot(pl[[j]], "coords")
+ nc <- nrow(crds)
+ lab <- paste(id[i], "/P_SP_ID", nc, sep="\t")
+ if (i > 1 || j > 1) cat("\n", file = con)
+ writeLines(lab, con = con)
+ write.table(crds, file = con,
+ append = TRUE,
+ row.names = FALSE,
+ col.names = FALSE, sep="\t", dec=".")
+ }
+
+ }
+ close(con)
+ }
+ invisible(NULL)
+}
+
+
+Shape2Mondrian <- function(shape, file, id, export.data = TRUE) {
+
+ fshape <- shape
+ xfile <- file
+ idx <- paste("/P", id, sep="")
+
+ #
+ # Export "att.data" -- TRUE / FALSE
+ #
+ if (is.logical(export.data) && export.data) {
+ y <- fshape$att.data
+ names(y) <- sub(id, idx, names(y))
+ write.table(y, file = xfile,
+ append = TRUE,
+ row.names = FALSE,
+ col.names = TRUE, sep="\t", dec=".")
+ }
+
+ for (i in 1:length(fshape$Shapes)) {
+
+ xnrow <- nrow(fshape$Shapes[[i]]$verts)
+ lab <- paste(i, idx, xnrow, sep="\t")
+
+ write.table("\n", file = xfile,
+ append = TRUE, eol = "",
+ quote = FALSE,
+ row.names = FALSE,
+ col.names = FALSE)
+ write.table(lab, file = xfile,
+ append = TRUE,
+ quote = FALSE,
+ row.names = FALSE,
+ col.names = FALSE, sep="\t")
+ write.table(fshape$Shapes[[i]]$verts, file = xfile,
+ append = TRUE,
+ row.names = FALSE,
+ col.names = FALSE, sep="\t", dec=".")
+ }
+}
+
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#library(maptools)
+#x <- read.shape(system.file("shapes/columbus.shp", package="maptools")[1])
+#Shape2Mondrian(x, file="c:\\colombus.txt", "POLYID", export.data = TRUE)
+#xx <- readShapePoly(system.file("shapes/columbus.shp", package="maptools")[1])
+#sp2Mondrian(xx, file="colombus1.txt")
+
diff --git a/R/sp2WB.R b/R/sp2WB.R
new file mode 100644
index 0000000..14c6c75
--- /dev/null
+++ b/R/sp2WB.R
@@ -0,0 +1,78 @@
+# 2005 (c) Virgilio Gomez Rubio, partly derived from
+# earlier code by Thomas Jagger
+
+# The code in this file exports and sp object into a S-Plus map
+# format to be import by WinBUGS.
+
+# file: file where output is written
+# map: sp object (SpatialPolygons object)
+# xScale/yScale: scales to be written in the output file
+
+sp2WB <- function(map, filename, Xscale=1, Yscale=Xscale, plotorder=FALSE) {
+
+# Write some tests here to ensure that all the objects passed
+# are of the appropriate type
+
+ f<-file(filename,"w")
+
+# Get the total number of areas and Rings
+ SRings<-slot(map, "polygons")
+ nareas<-length(SRings)
+ nRings<-sum(sapply(SRings, function(x) length(slot(x, "Polygons"))))
+ IDs<-sapply(SRings, function(i) slot(i, "ID"))
+
+# Plot header of the f
+ cat(file=f, "map:",nareas, "\n", sep="")
+ cat(file=f, "Xscale:", Xscale, "\n", sep="")
+ cat(file=f, "Yscale:", Yscale, "\n", sep="")
+ cat(file=f, "\n")
+
+ if(plotorder)
+ porder <- slot(map, "plotOrder")
+ else
+ porder<-1:nareas
+
+# Different
+ for(area in (1:nareas)[porder])
+ cat(file=f, area, " area", IDs[area], "\n", sep="")
+
+ cat(file=f, "\n")
+
+ index<-1
+# Loop to print all the individual rings
+ for(area in (1:nareas)[porder]) {
+ label<-paste("area", IDs[area], sep="")
+ Rings<-slot(SRings[[area]], "Polygons")
+ lRings<-length(Rings)
+
+ if(plotorder)
+ porderrings<-slot(Rings, "plotOrder")
+ else
+ porderrings<-1:lRings
+
+ for(ring in (1:lRings)[porderrings]) {
+ coords<-slot(Rings[[ring]], "coords")
+ ncoords<-length(coords[,1])
+
+# Should we check that there are only x/y coordinates?
+ xcrd <- formatC(coords[,1], format="f")
+ ycrd <- formatC(coords[,2], format="f")
+ for(i in 1:ncoords)
+ cat(file=f, label, xcrd[i], ycrd[i],
+ "\n")
+
+ if(index<nRings)
+ cat(file=f, "NA", "NA", "NA\n")
+ else
+ cat(file=f, "\n")
+
+ index<-index+1
+ }
+
+ }
+
+ cat(file=f, "END\n")
+ close(f)
+ invisible(NULL)
+}
+
diff --git a/R/sp2pbs.R b/R/sp2pbs.R
new file mode 100644
index 0000000..15b71f8
--- /dev/null
+++ b/R/sp2pbs.R
@@ -0,0 +1,183 @@
+# PBSmapping utilities
+
+SpatialPolygons2PolySet <- function(SpP) {
+ require(PBSmapping)
+ pls <- slot(SpP, "polygons")
+ n <- length(pls)
+ PID <- NULL
+ SID <- NULL
+ POS <- NULL
+ X <- NULL
+ Y <- NULL
+ for (i in 1:n) {
+ srs <- slot(pls[[i]], "Polygons")
+ m <- length(srs)
+ for (j in 1:m) {
+ crds <- slot(srs[[j]], "coords")
+ k <- nrow(crds)
+ PID <- c(PID, rep(i, k))
+ SID <- c(SID, rep(j, k))
+ POS <- c(POS, 1:k)
+ X <- c(X, crds[,1])
+ Y <- c(Y, crds[,2])
+ }
+ }
+ PID <- as.integer(PID)
+ SID <- as.integer(SID)
+ POS <- as.integer(POS)
+ X <- as.double(X)
+ Y <- as.double(Y)
+ require(PBSmapping)
+ pj <- .pbsproj(SpP)
+ zn <- NULL
+ if (pj == "UTM") {
+ zn <- attr(pj, "zone")
+ attr(pj, "zone") <- NULL
+ }
+ res <- as.PolySet(data.frame(PID=PID, SID=SID, POS=POS, X=X, Y=Y),
+ projection=pj, zone=zn)
+ res
+}
+
+SpatialLines2PolySet <- function(SL) {
+# require(maps)
+ pls <- slot(SL, "lines")
+ n <- length(pls)
+ PID <- NULL
+ SID <- NULL
+ POS <- NULL
+ X <- NULL
+ Y <- NULL
+ for (i in 1:n) {
+ srs <- slot(pls[[i]], "Lines")
+ m <- length(srs)
+ for (j in 1:m) {
+ crds <- coordinates(srs[[j]])
+ k <- nrow(crds)
+ PID <- c(PID, rep(i, k))
+ SID <- c(SID, rep(j, k))
+ POS <- c(POS, 1:k)
+ X <- c(X, crds[,1])
+ Y <- c(Y, crds[,2])
+ }
+ }
+ PID <- as.integer(PID)
+ SID <- as.integer(SID)
+ POS <- as.integer(POS)
+ X <- as.double(X)
+ Y <- as.double(Y)
+ require(PBSmapping)
+ pj <- .pbsproj(SL)
+ zn <- NULL
+ if (pj == "UTM") {
+ zn <- attr(pj, "zone")
+ attr(pj, "zone") <- NULL
+ }
+ res <- as.PolySet(data.frame(PID=PID, SID=SID, POS=POS, X=X, Y=Y),
+ projection=pj, zone=zn)
+ res
+}
+
+.pbsproj <- function(Sobj) {
+ p4str <- proj4string(Sobj)
+ if (is.na(p4str)) return("1")
+ res <- grep("longlat", p4str, fixed=TRUE)
+ if (length(res) > 0) return("LL")
+ res <- regexpr("utm", p4str, fixed=TRUE)
+ if (res > 0) {
+ val <- "UTM"
+ res <- regexpr("+zone=", p4str, fixed=TRUE)
+ sres <- substring(p4str, res+attr(res, "match.length"))
+ zn0 <- regexpr("[[:digit:]]+", sres)
+ attr(val, "zone") <- as.integer(substring(sres, zn0,
+ zn0+attr(zn0, "match.length")))
+ } else val <- "1"
+ val
+}
+
+PolySet2SpatialPolygons <- function(PS, close_polys=TRUE) {
+ if (!inherits(PS, "PolySet")) stop("not a PolySet object")
+ prj <- attr(PS, "projection")
+ if (is.null(prj)) stop("unknown coordinate reference system")
+ if (prj == "LL") p4s <- "+proj=longlat"
+ else if (prj == "UTM") {
+# apparent change in PBS object attributes
+ zn <- attr(prj, "zone")
+ if (is.null(zn)) zn <- attr(PS, "zone")
+ if (is.null(zn)) stop("no valid zone attribute")
+ p4s <- paste("+proj=utm +zone=", zn, sep="")
+ } else stop("unknown coordinate reference system")
+ hasPID <- "PID" %in% names(PS)
+ if (!hasPID) stop("object does not have PID column")
+ res0 <- split(PS, PS$PID)
+ hasSID <- "SID" %in% names(PS)
+ outPolygons <- vector(mode="list", length=length(res0))
+ if (hasSID) {
+ res1 <- lapply(res0, function(x) split(x, x$SID))
+ if (close_polys) res1 <- lapply(res1,
+ function(i) lapply(i, function(x) {
+ n <- nrow(x)
+ if (!isTRUE(identical(x$X[1], x$X[n])) ||
+ !isTRUE(identical(x$Y[1], x$Y[n]))) rbind(x, x[1,])
+ else x
+ })
+ )
+# extra level added to fix bug found by A Lobos 080413
+ for (i in seq(along=outPolygons)) {
+ outPolygons[[i]] <- Polygons(lapply(res1[[i]], function(x)
+ Polygon(cbind(x$X, x$Y))), ID=names(res1)[i])
+ }
+# PIDs added as IDs 080413
+ } else {
+ if (close_polys) res0 <- lapply(res0, function(x) {
+ n <- nrow(x)
+ if (!isTRUE(identical(x$X[1], x$X[n])) ||
+ !isTRUE(identical(x$Y[1], x$Y[n]))) rbind(x, x[1,])
+ else x
+ })
+ for (i in seq(along=outPolygons)) {
+ outPolygons[[i]] <- Polygons(list(Polygon(cbind(res0[[i]]$X,
+ res0[[i]]$Y))), ID=as.character(i))
+ }
+ }
+ outSP <- SpatialPolygons(outPolygons, proj4string=CRS(p4s))
+ outSP
+}
+
+PolySet2SpatialLines <- function(PS) {
+ if (!inherits(PS, "PolySet")) stop("not a PolySet object")
+ prj <- attr(PS, "projection")
+ prj <- attr(PS, "projection")
+ if (is.null(prj)) stop("unknown coordinate reference system")
+ if (prj == "LL") p4s <- "+proj=longlat"
+ else if (prj == "UTM") {
+# apparent change in PBS object attributes
+ zn <- attr(prj, "zone")
+ if (is.null(zn)) zn <- attr(PS, "zone")
+ if (is.null(zn)) stop("no valid zone attribute")
+ p4s <- paste("+proj=utm +zone=", zn, sep="")
+ } else stop("unknown coordinate reference system")
+ hasPID <- "PID" %in% names(PS)
+ if (!hasPID) stop("object does not have PID column")
+ res0 <- split(PS, PS$PID)
+ hasSID <- "SID" %in% names(PS)
+ outLines <- vector(mode="list", length=length(res0))
+ if (hasSID) {
+ res1 <- lapply(res0, function(x) split(x, x$SID))
+ for (i in seq(along=outLines)) {
+ outLines[[i]] <- Lines(lapply(res1[[i]], function(x)
+ Line(cbind(x$X, x$Y))), ID=as.character(i))
+ }
+ } else {
+ for (i in seq(along=outLines)) {
+ outLines[[i]] <- Lines(lapply(res0[[i]], function(x)
+ Line(cbind(res0[[i]]$X, res0[[i]]$Y))), ID=as.character(i))
+ }
+ }
+ outSP <- SpatialLines(outLines, proj4string=CRS(p4s))
+ outSP
+
+
+}
+
+
diff --git a/R/sp2tmap.R b/R/sp2tmap.R
new file mode 100644
index 0000000..f8b2ee6
--- /dev/null
+++ b/R/sp2tmap.R
@@ -0,0 +1,34 @@
+sp2tmap <- function(SP) {
+ if (!inherits(SP, "SpatialPolygons"))
+ stop("not a SpatialPolygons object")
+ pls <- slot(SP, "polygons")
+ IDs <- sapply(pls, function(x) slot(x, "ID"))
+ n <- length(IDs)
+ iIDs <- as.integer(1:n)
+ cID <- NULL
+ cX <- NULL
+ cY <- NULL
+ for (i in iIDs) {
+ pl <- slot(pls[[i]], "Polygons")
+ m <- length(pl)
+ for (j in 1:m) {
+ crds <- slot(pl[[j]], "coords")
+ if (is.null(cID)) {
+ cID <- i
+ cX <- as.numeric(NA)
+ cY=as.numeric(NA)
+ } else {
+ cID <- c(cID, i)
+ cX <- c(cX, as.numeric(NA))
+ cY <- c(cY, as.numeric(NA))
+ }
+ cID <- c(cID, rep(i, nrow(crds)))
+ cX <- c(cX, crds[,1])
+ cY <- c(cY, crds[,2])
+ }
+ }
+ res <- data.frame("_ID"=cID, "_X"=cX, "_Y"=cY, check.names=FALSE)
+ names(iIDs) <- IDs
+ attr(res, "ID_names") <- iIDs
+ res
+}
diff --git a/R/sp_bind.R b/R/sp_bind.R
new file mode 100644
index 0000000..bbff274
--- /dev/null
+++ b/R/sp_bind.R
@@ -0,0 +1,205 @@
+if (!isGeneric("spCbind"))
+ setGeneric("spCbind", function(obj, x)
+ standardGeneric("spCbind"))
+
+cbindSpatialPointsDataFrame <- function(obj, x) {
+ x0 <- slot(obj, "data")
+ if (nrow(x0) != nrow(x)) stop("different numbers of rows")
+ cx <- data.frame(x0, x)
+ SpatialPointsDataFrame(as(obj, "SpatialPoints"), data=cx)
+}
+
+cbindSpatialPointsDataFramev <- function(obj, x) {
+ x0 <- slot(obj, "data")
+ if (nrow(x0) != length(x)) stop("different numbers of rows")
+ nx <- deparse(substitute(x))
+ x <- as.data.frame(x)
+ names(x) <- nx
+ cx <- data.frame(x0, x)
+ SpatialPointsDataFrame(as(obj, "SpatialPoints"), data=cx)
+}
+
+setMethod("spCbind", signature(obj="SpatialPointsDataFrame", x="data.frame"),
+ cbindSpatialPointsDataFrame)
+
+setMethod("spCbind", signature(obj="SpatialPointsDataFrame", x="vector"),
+ cbindSpatialPointsDataFramev)
+
+cbindSpatialLinesDataFrame <- function(obj, x) {
+ x0 <- slot(obj, "data")
+ if (nrow(x0) != nrow(x)) stop("different numbers of rows")
+ if (!isTRUE(all.equal(row.names(x0), row.names(x))))
+ stop("row names not identical")
+ cx <- data.frame(x0, x)
+ SpatialLinesDataFrame(as(obj, "SpatialLines"), data=cx)
+}
+
+cbindSpatialLinesDataFramev <- function(obj, x) {
+ x0 <- slot(obj, "data")
+ if (nrow(x0) != length(x)) stop("different numbers of rows")
+ nx <- deparse(substitute(x))
+ x <- as.data.frame(x)
+ names(x) <- nx
+ cx <- data.frame(x0, x)
+ SpatialLinesDataFrame(as(obj, "SpatialLines"), data=cx)
+}
+
+setMethod("spCbind", signature(obj="SpatialLinesDataFrame", x="data.frame"),
+ cbindSpatialLinesDataFrame)
+
+setMethod("spCbind", signature(obj="SpatialLinesDataFrame", x="vector"),
+ cbindSpatialLinesDataFramev)
+
+cbindSpatialPolygonsDataFrame <- function(obj, x) {
+ x0 <- slot(obj, "data")
+ if (nrow(x0) != nrow(x)) stop("different numbers of rows")
+ if (!isTRUE(all.equal(row.names(x0), row.names(x))))
+ stop("row names not identical")
+ cx <- data.frame(x0, x)
+ SpatialPolygonsDataFrame(as(obj, "SpatialPolygons"), data=cx)
+}
+
+cbindSpatialPolygonsDataFramev <- function(obj, x) {
+ x0 <- slot(obj, "data")
+ if (nrow(x0) != length(x)) stop("different numbers of rows")
+ nx <- deparse(substitute(x))
+ x <- as.data.frame(x)
+ names(x) <- nx
+ cx <- data.frame(x0, x)
+ SpatialPolygonsDataFrame(as(obj, "SpatialPolygons"), data=cx)
+}
+
+setMethod("spCbind", signature(obj="SpatialPolygonsDataFrame", x="data.frame"),
+ cbindSpatialPolygonsDataFrame)
+
+setMethod("spCbind", signature(obj="SpatialPolygonsDataFrame", x="vector"),
+ cbindSpatialPolygonsDataFramev)
+
+
+if (!isGeneric("spRbind"))
+ setGeneric("spRbind", function(obj, x)
+ standardGeneric("spRbind"))
+
+rbindSpatialPoints <- function(obj, x) {
+ if (!isTRUE(all.equal(proj4string(obj), proj4string(x))))
+ stop("coordinate reference systems differ")
+ crds <- rbind(coordinates(obj), coordinates(x))
+ SpatialPoints(crds, proj4string=CRS(proj4string(obj)))
+}
+
+setMethod("spRbind", signature(obj="SpatialPoints", x="SpatialPoints"),
+ rbindSpatialPoints)
+
+rbindSpatialPointsDataFrame <- function(obj, x) {
+ SP <- spRbind(as(obj, "SpatialPoints"), as(x, "SpatialPoints"))
+ df <- rbind(as(obj, "data.frame"), as(x, "data.frame"))
+ SpatialPointsDataFrame(SP, data=df)
+}
+
+setMethod("spRbind", signature(obj="SpatialPointsDataFrame",
+ x="SpatialPointsDataFrame"), rbindSpatialPointsDataFrame)
+
+rbindSpatialLines <- function(obj, x) {
+ if (!isTRUE(all.equal(proj4string(obj), proj4string(x))))
+ stop("coordinate reference systems differ")
+ ll1 <- slot(obj, "lines")
+ ll2 <- slot(x, "lines")
+ ID1 <- sapply(ll1, function(x) slot(x, "ID"))
+ ID2 <- sapply(ll2, function(x) slot(x, "ID"))
+ if (length(c(ID1, ID2)) > length(unique(c(ID1, ID2))))
+ stop("non-unique line IDs")
+ LL <- c(ll1, ll2)
+ SpatialLines(LL, proj4string=CRS(proj4string(obj)))
+}
+
+setMethod("spRbind", signature(obj="SpatialLines", x="SpatialLines"),
+ rbindSpatialLines)
+
+rbindSpatialLinesDataFrame <- function(obj, x) {
+ SL <- spRbind(as(obj, "SpatialLines"), as(x, "SpatialLines"))
+ df <- rbind(as(obj, "data.frame"), as(x, "data.frame"))
+ SpatialLinesDataFrame(SL, data=df)
+}
+
+setMethod("spRbind", signature(obj="SpatialLinesDataFrame",
+ x="SpatialLinesDataFrame"), rbindSpatialLinesDataFrame)
+
+
+rbindSpatialPolygons <- function(obj, x) {
+ if (!isTRUE(all.equal(proj4string(obj), proj4string(x))))
+ stop("coordinate reference systems differ")
+ pl1 <- slot(obj, "polygons")
+ pl2 <- slot(x, "polygons")
+ ID1 <- sapply(pl1, function(x) slot(x, "ID"))
+ ID2 <- sapply(pl2, function(x) slot(x, "ID"))
+ if (length(c(ID1, ID2)) > length(unique(c(ID1, ID2))))
+ stop("non-unique polygon IDs")
+ PL <- c(pl1, pl2)
+ SpatialPolygons(PL, proj4string=CRS(proj4string(obj)))
+}
+
+setMethod("spRbind", signature(obj="SpatialPolygons", x="SpatialPolygons"),
+ rbindSpatialPolygons)
+
+rbindSpatialPolygonsDataFrame <- function(obj, x) {
+ SP <- spRbind(as(obj, "SpatialPolygons"), as(x, "SpatialPolygons"))
+ df <- rbind(as(obj, "data.frame"), as(x, "data.frame"))
+ SpatialPolygonsDataFrame(SP, data=df)
+}
+
+setMethod("spRbind", signature(obj="SpatialPolygonsDataFrame",
+ x="SpatialPolygonsDataFrame"), rbindSpatialPolygonsDataFrame)
+
+
+
+
+
+if (!isGeneric("spChFIDs"))
+ setGeneric("spChFIDs", function(obj, x)
+ standardGeneric("spChFIDs"))
+
+chFIDsSpatialLines <- function(obj, x) {
+ nl <- length(slot(obj, "lines"))
+ if (length(x) != nl) stop("lengths differ")
+ if (length(x) > length(unique(x))) stop("duplicate IDs")
+ for (i in 1:nl) slot(slot(obj, "lines")[[i]], "ID") <- x[i]
+ obj
+}
+
+setMethod("spChFIDs", signature(obj="SpatialLines", x="character"),
+ chFIDsSpatialLines)
+
+chFIDsSpatialLinesDataFrame <- function(obj, x) {
+ SL <- as(obj, "SpatialLines")
+ SLx <- spChFIDs(SL, x)
+ df <- as(obj, "data.frame")
+ row.names(df) <- sapply(slot(SLx, "lines"), function(x) slot(x, "ID"))
+ SpatialLinesDataFrame(SLx, data=df)
+}
+
+setMethod("spChFIDs", signature(obj="SpatialLinesDataFrame", x="character"),
+ chFIDsSpatialLinesDataFrame)
+
+chFIDsSpatialPolygons <- function(obj, x) {
+ np <- length(slot(obj, "polygons"))
+ if (length(x) != np) stop("lengths differ")
+ if (length(x) > length(unique(x))) stop("duplicate IDs")
+ for (i in 1:np) slot(slot(obj, "polygons")[[i]], "ID") <- x[i]
+ obj
+}
+
+setMethod("spChFIDs", signature(obj="SpatialPolygons", x="character"),
+ chFIDsSpatialPolygons)
+
+chFIDsSpatialPolygonsDataFrame <- function(obj, x) {
+ SP <- as(obj, "SpatialPolygons")
+ SPx <- spChFIDs(SP, x)
+ df <- as(obj, "data.frame")
+ row.names(df) <- sapply(slot(SPx, "polygons"), function(x) slot(x, "ID"))
+ SpatialPolygonsDataFrame(SPx, data=df)
+}
+
+setMethod("spChFIDs", signature(obj="SpatialPolygonsDataFrame", x="character"),
+ chFIDsSpatialPolygonsDataFrame)
+
+
diff --git a/R/sp_spat1.R b/R/sp_spat1.R
new file mode 100644
index 0000000..2bfc829
--- /dev/null
+++ b/R/sp_spat1.R
@@ -0,0 +1,71 @@
+# sp functions:
+if (!isClass("ppp"))
+ setClass("ppp")
+
+if (!isClass("psp"))
+ setClass("psp")
+
+if (!isClass("owin"))
+ setClass("owin")
+
+if (!isClass("im"))
+ setClass("im")
+
+as.SpatialPoints.ppp = function(from) {
+ mult <- 1
+ if (!is.null(from$window$units) && !is.null(from$window$units$multiplier))
+ mult <- from$window$units$multiplier
+ crds <- cbind(mult*as.double(from$x), mult*as.double(from$y))
+ if (from$window$type == "rectangle") {
+ ow <- from$window
+ bbox <- rbind(mult*as.double(ow$xrange), mult*as.double(ow$yrange))
+ colnames(bbox) <- c("min", "max")
+ } else bbox <- NULL
+ SpatialPoints(coords=crds, bbox=bbox)
+}
+setAs("ppp", "SpatialPoints", as.SpatialPoints.ppp)
+
+as.SpatialPointsDataFrame.ppp = function(from) {
+ SP <- as(from, "SpatialPoints")
+ SpatialPointsDataFrame(SP, data.frame(marks = from$marks))
+}
+setAs("ppp", "SpatialPointsDataFrame", as.SpatialPointsDataFrame.ppp)
+
+as.SpatialGridDataFrame.ppp = function(from) {
+ require(spatstat)
+ w = from$window
+ if (w$type != "mask")
+ stop("window is not of type mask")
+ offset = c(w$xrange[1] + 0.5 * w$xstep, w$yrange[1] + 0.5 * w$ystep)
+ cellsize = c(diff(w$xrange)/w$dim[2], diff(w$yrange)/w$dim[1])
+ dim = c(w$dim[2], w$dim[1])
+ gt = GridTopology(offset, cellsize, dim)
+ m = t(w$m[nrow(w$m):1,])
+ m[!m] = NA
+ data = data.frame(mask = as.vector(m))
+ SpatialGridDataFrame(gt, data)
+}
+setAs("ppp", "SpatialGridDataFrame", as.SpatialGridDataFrame.ppp)
+
+as.SpatialGridDataFrame.im = function(from) {
+ require(spatstat)
+ offset = c(from$xrange[1] + 0.5 * from$xstep, from$yrange[1] +
+ 0.5 * from$ystep)
+ cellsize = c(diff(from$xrange)/from$dim[2], diff(from$yrange)/from$dim[1])
+ dim = c(from$dim[2], from$dim[1])
+ gt = GridTopology(offset, cellsize, dim)
+ m = t(from$v[nrow(from$v):1,])
+ data = data.frame(v = as.vector(m))
+ SpatialGridDataFrame(gt, data)
+}
+setAs("im", "SpatialGridDataFrame", as.SpatialGridDataFrame.im)
+
+
+as.im.SpatialGridDataFrame = function(from) {
+ require(spatstat)
+ xi <- sp:::as.image.SpatialGridDataFrame(from)
+ im(t(xi$z), xcol=xi$x, yrow=xi$y)
+}
+setAs("SpatialGridDataFrame", "im", as.im.SpatialGridDataFrame)
+
+
diff --git a/R/sp_tools.R b/R/sp_tools.R
new file mode 100644
index 0000000..7e70124
--- /dev/null
+++ b/R/sp_tools.R
@@ -0,0 +1,145 @@
+MapGen2SL <- function(file, proj4string=CRS(as.character(NA))) {
+ con <- file(file, "r")
+ hold <- readLines(con)
+ close(con)
+ if (length(hold) == 500000) warning("500,000 point limit reached")
+ starts <- which(hold == "# -b")
+ n <- length(starts)
+ if (n < 1) stop("Not a Mapgen format file")
+ res <- vector(mode="list", length=n)
+ IDs <- paste("L", 1:n, sep="_")
+ for (i in 1:n) {
+ if (i < n) {
+ x <- t(sapply(strsplit(hold[(starts[i]+1):
+ (starts[i+1]-1)], "\t"), as.numeric))
+ } else {
+ x <- t(sapply(strsplit(hold[(starts[i]+1):
+ length(hold)], "\t"), as.numeric))
+ }
+ res[[i]] <- Lines(list(Line(x
+#, proj4string=proj4string
+)), ID=IDs[i])
+ }
+ SL <- SpatialLines(res, proj4string=proj4string)
+ SL
+}
+
+ArcObj2SLDF <- function(arc, proj4string=CRS(as.character(NA)), IDs) {
+ df <- data.frame(arc[[1]])
+ n <- length(arc[[2]])
+ LinesList <- vector(mode="list", length=n)
+ if (missing(IDs)) IDs <- paste("L", 1:n, sep="_")
+ if (length(IDs) != n) stop("IDs length differs from number of arcs")
+ row.names(df) <- IDs
+ for (i in 1:n) {
+ crds <- cbind(arc[[2]][[i]][[1]], arc[[2]][[i]][[2]])
+ LinesList[[i]] <- Lines(list(Line(coords=crds
+#, proj4string=proj4string
+)), ID=IDs[i])
+ }
+ SL <- SpatialLines(LinesList, proj4string=proj4string)
+ res <- SpatialLinesDataFrame(SL, data=df)
+ res
+}
+
+ContourLines2SLDF <- function(cL, proj4string=CRS(as.character(NA))) {
+ if (length(cL) < 1) stop("cL too short")
+ cLstack <- tapply(1:length(cL), sapply(cL, function(x) x[[1]]),
+ function(x) x, simplify=FALSE)
+ df <- data.frame(level=names(cLstack))
+ m <- length(cLstack)
+ res <- vector(mode="list", length=m)
+ IDs <- paste("C", 1:m, sep="_")
+ row.names(df) <- IDs
+ for (i in 1:m) {
+ res[[i]] <- Lines(.contourLines2LineList(cL[cLstack[[i]]]#,
+# proj4string=proj4string
+), ID=IDs[i])
+ }
+ SL <- SpatialLines(res, proj4string=proj4string)
+ res <- SpatialLinesDataFrame(SL, data=df)
+ res
+}
+.contourLines2LineList <- function(cL#, proj4string=CRS(as.character(NA))
+) {
+ n <- length(cL)
+ res <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ crds <- cbind(cL[[i]][[2]], cL[[i]][[3]])
+ res[[i]] <- Line(coords=crds#, proj4string=proj4string
+)
+ }
+ res
+}
+
+# to be moved to glue with RarcInfo:
+
+pal2SpatialPolygons <- function(arc, pal, IDs, dropPoly1=TRUE,
+ proj4string=CRS(as.character(NA))) {
+ if (missing(IDs)) stop("IDs required")
+ if (dropPoly1) pale <- lapply(pal[[2]][-1], function(x) x[[1]])
+ else pale <- lapply(pal[[2]], function(x) x[[1]])
+ if (length(pale) != length(IDs)) stop("map and IDs differ in length")
+ tab <- table(factor(IDs))
+ n <- length(tab)
+ IDss <- names(tab)
+ reg <- match(IDs, IDss)
+ belongs <- lapply(1:n, function(x) which(x == reg))
+# assemble the list of Polygons
+ Srl <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ bi <- belongs[[i]]
+ nParts <- length(bi)
+ palei_list <- list()
+ for (j in 1:nParts) {
+ this <- bi[j]
+ paleij <- pale[[this]]
+ if (any(paleij == 0)) {
+ zeros <- which(paleij == 0)
+ palei_list <- c(palei_list,
+ list(paleij[1:(zeros[1]-1)]))
+ for (k in 1:length(zeros)) {
+ if (k == length(zeros)) {
+ lp <- length(paleij)
+ lz <- zeros[length(zeros)]
+ palei_list <- c(palei_list,
+ list(paleij[(lz+1):lp]))
+ } else {
+ zk <- zeros[k]
+ zk1 <- zeros[k+1]
+ palei_list <- c(palei_list,
+ list(paleij[(zk+1):(zk1-1)]))
+ }
+ }
+ } else palei_list <- c(palei_list, list(paleij))
+ }
+ nParts <- length(palei_list)
+ srl <- vector(mode="list", length=nParts)
+ for (j in 1:nParts) {
+ paleij <- palei_list[[j]]
+ nArcs <- length(paleij)
+ x <- NULL
+ y <- NULL
+ for (k in 1:nArcs) {
+ kk <- paleij[k]
+ if (kk > 0) {
+ x <- c(x, arc[[2]][[kk]][[1]])
+ y <- c(y, arc[[2]][[kk]][[2]])
+ } else {
+ x <- c(x, rev(arc[[2]][[-kk]][[1]]))
+ y <- c(y, rev(arc[[2]][[-kk]][[2]]))
+ }
+ }
+ if ((x[1] != x[length(x)]) || (y[1] != y[length(y)])) {
+ x <- c(x, x[1])
+ y <- c(y, y[1])
+ }
+ srl[[j]] <- Polygon(coords=cbind(x, y))
+ }
+ Srl[[i]] <- Polygons(srl, ID=IDss[i])
+ }
+ res <- as.SpatialPolygons.PolygonsList(Srl, proj4string=proj4string)
+ res
+}
+
+
diff --git a/R/spatstat1.R b/R/spatstat1.R
new file mode 100644
index 0000000..656009f
--- /dev/null
+++ b/R/spatstat1.R
@@ -0,0 +1,120 @@
+# as.ppp method to be used in spatstat:
+
+as.ppp.SpatialPoints = function(X) {
+ require(spatstat)
+ bb <- bbox(X)
+ colnames(bb) <- NULL
+ W = owin(bb[1,], bb[2,])
+ cc = coordinates(X)
+ return(ppp(cc[,1], cc[,2], window = W, marks = NULL))
+}
+
+setAs("SpatialPoints", "ppp", function(from) as.ppp.SpatialPoints(from))
+
+as.ppp.SpatialPointsDataFrame = function(X) {
+ require(spatstat)
+ W = owin(bbox(X)[1,], bbox(X)[2,])
+ if (ncol(X) > 1)
+ stop("ppp objects only accept a single attribute column; please select one")
+ marks = X[[1]]
+ cc = coordinates(X)
+ return(ppp(cc[,1], cc[,2], window = W, marks = marks))
+}
+
+setAs("SpatialPointsDataFrame", "ppp", function(from) as.ppp.SpatialPointsDataFrame(from))
+
+as.owin.SpatialGridDataFrame = function(W, ..., fatal) {
+ require(spatstat)
+ # W = from
+ m = t(!is.na(as(W, "matrix")))
+ owin(bbox(W)[1,], bbox(W)[2,], mask = m[nrow(m):1,])
+}
+
+setAs("SpatialGridDataFrame", "owin", function(from) as.owin.SpatialGridDataFrame(from))
+
+as.owin.SpatialPixelsDataFrame = function(W, ..., fatal) {
+ require(spatstat)
+ # W = from
+ m = t(!is.na(as(W, "matrix")))
+ owin(bbox(W)[1,], bbox(W)[2,], mask = m[nrow(m):1,])
+}
+
+setAs("SpatialPixelsDataFrame", "owin", function(from) as.owin.SpatialPixelsDataFrame(from))
+
+as.owin.SpatialPolygons = function(W, ..., fatal) {
+ require(spatstat)
+ # W = from
+ if (!inherits(W, "SpatialPolygons"))
+ stop("W must be a SpatialPolygons object")
+ res <- .SP2owin(W)
+ res
+}
+
+setAs("SpatialPolygons", "owin", function(from) as.owin.SpatialPolygons(from))
+
+# methods for 'as.psp' for sp classes
+
+as.psp.Line <- function(from, ..., window=NULL, marks=NULL, fatal) {
+ xy <- from at coords
+ xrange <- range(xy[,1])
+ yrange <- range(xy[,2])
+ df <- as.data.frame(cbind(xy[-nrow(xy), , drop=FALSE], xy[-1, ,
+drop=FALSE]))
+ if(is.null(window))
+ window <- owin(xrange, yrange)
+ return(as.psp(df, window=window, marks=marks))
+}
+
+setAs("Line", "psp", function(from) as.psp.Line(from))
+
+as.psp.Lines <- function(from, ..., window=NULL, marks=NULL, fatal) {
+ y <- lapply(from at Lines, as.psp.Line, window=window)
+ z <- superimposePSP(y, window=window)
+ if(!is.null(marks))
+ marks(z) <- marks
+ return(z)
+}
+
+setAs("Lines", "psp", function(from) as.psp.Lines(from))
+
+as.psp.SpatialLines <- function(from, ..., window=NULL, marks=NULL, fatal) {
+ lin <- from at lines
+ y <- lapply(lin, as.psp.Lines)
+ id <- unlist(lapply(lin, function(s) { s at ID }))
+ if(is.null(marks))
+ for(i in seq(y))
+ marks(y[[i]]) <- id[i]
+ if(is.null(window)) {
+ w <- from at bbox
+ window <- owin(w[1,], w[2,])
+ }
+ z <- do.call("superimposePSP", list(y, window=window))
+ if(!is.null(marks))
+ marks(z) <- marks
+ return(z)
+}
+
+setAs("SpatialLines", "psp", function(from) as.psp.SpatialLines(from))
+
+as.psp.SpatialLinesDataFrame <- function(from, ..., window=NULL, marks=NULL, fatal) {
+ y <- as(from, "SpatialLines")
+ z <- as.psp(y, window=window, marks=marks)
+ if(is.null(marks)) {
+ # extract marks from first column of data frame
+ df <- from at data
+ if(is.null(df))
+ return(z)
+ if((nc <- ncol(df)) > 1)
+ warning(paste(nc-1, "columns of data frame discarded"))
+ marx <- df[,1]
+ nseg.Line <- function(x) { return(nrow(x at coords)-1) }
+ nseg.Lines <- function(x) { return(unlist(lapply(x at Lines, nseg.Line))) }
+ nrep <- unlist(lapply(y at lines, nseg.Lines))
+ marks(z) <- rep(marx, nrep)
+ }
+ return(z)
+}
+
+setAs("SpatialLinesDataFrame", "psp", function(from) as.psp.SpatialLinesDataFrame(from))
+
+
diff --git a/R/spmaps.R b/R/spmaps.R
new file mode 100644
index 0000000..2c26746
--- /dev/null
+++ b/R/spmaps.R
@@ -0,0 +1,107 @@
+.NAmat2xyList <- function(xy) {
+ NAs <- unclass(attr(na.omit(xy), "na.action"))
+ if ((length(NAs) == 1) && (NAs == nrow(xy))) {
+ xy <- xy[-nrow(xy)]
+ NAs <- NULL
+ }
+# NA problem found by Edzer Pebesma, 24/8-06
+ diffNAs <- diff(NAs)
+ if (any(diffNAs == 1)) {
+ xy <- xy[-(NAs[which(diffNAs == 1)] + 1), ]
+ NAs <- unclass(attr(na.omit(xy), "na.action"))
+ }
+ nParts <- length(NAs) + 1
+# two NAs at end of file 070905 RSB
+# no NAs at all RSB 080814
+ if (!is.null(NAs) && nrow(xy) == NAs[length(NAs)])
+ nParts <- nParts - 1
+ res <- vector(mode="list", length=nParts)
+ from <- integer(nParts)
+ to <- integer(nParts)
+ from[1] <- 1
+ to[nParts] <- nrow(xy)
+# two NAs at end of file 070905 RSB
+# no NAs at all RSB 080814
+ if (!is.null(NAs) && nrow(xy) == NAs[length(NAs)])
+ to[nParts] <- to[nParts] - 1
+ if (nParts > 1) {
+ for (i in 2:nParts) {
+ to[(i-1)] <- NAs[(i-1)]-1
+ from[i] <- NAs[(i-1)]+1
+ }
+ }
+ for (i in 1:nParts) res[[i]] <- xy[from[i]:to[i],, drop = FALSE]
+ res
+}
+
+map2SpatialLines <- function(map, IDs=NULL, proj4string=CRS(as.character(NA))) {
+ require(maps)
+ xyList <- .NAmat2xyList(cbind(map$x, map$y))
+ if (is.null(IDs)) IDs <- as.character(1:length(xyList))
+
+ if (length(xyList) != length(IDs)) stop("map and IDs differ in length")
+ tab <- table(factor(IDs))
+ n <- length(tab)
+ IDss <- names(tab)
+ reg <- match(IDs, IDss)
+ belongs <- lapply(1:n, function(x) which(x == reg))
+# assemble the list of Lines
+ Srl <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ nParts <- length(belongs[[i]])
+ srl <- vector(mode="list", length=nParts)
+ for (j in 1:nParts) {
+ crds <- xyList[[belongs[[i]][j]]]
+ if (nrow(crds) > 1) srl[[j]] <- Line(coords=crds)
+ else srl[[j]] <- Line(coords=rbind(crds, crds))
+ }
+ Srl[[i]] <- Lines(srl, ID=IDss[i])
+ }
+ res <- SpatialLines(Srl, proj4string=proj4string)
+ res
+}
+
+pruneMap <- function(map, xlim=NULL, ylim=NULL) {
+ candx <- NULL
+ if (!is.null(xlim)) {
+ if (length(xlim) != 2) stop("xlim must be of length 2")
+ candx <- which(map$x < xlim[1] | map$x > xlim[2])
+ }
+ candy <- NULL
+ if (!is.null(ylim)) {
+ if (length(ylim) != 2) stop("ylim must be of length 2")
+ candy <- which(map$y < ylim[1] | map$y > ylim[2])
+ }
+ if (is.null(candx) && is.null(candy)) return(map)
+ cand <- unique(sort(c(candx, candy)))
+ map$x <- map$x[-cand]
+ map$y <- map$y[-cand]
+ map
+}
+
+# to be moved to glue with maps:
+
+map2SpatialPolygons <- function(map, IDs, proj4string=CRS(as.character(NA))) {
+ require(maps)
+ if (missing(IDs)) stop("IDs required")
+ xyList <- .NAmat2xyList(cbind(map$x, map$y))
+ if (length(xyList) != length(IDs)) stop("map and IDs differ in length")
+ tab <- table(factor(IDs))
+ n <- length(tab)
+ IDss <- names(tab)
+ reg <- match(IDs, IDss)
+ belongs <- lapply(1:n, function(x) which(x == reg))
+# assemble the list of Srings
+ Srl <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ nParts <- length(belongs[[i]])
+ srl <- vector(mode="list", length=nParts)
+ for (j in 1:nParts) {
+ srl[[j]] <- Polygon(coords=xyList[[belongs[[i]][j]]])
+ }
+ Srl[[i]] <- Polygons(srl, ID=IDss[i])
+ }
+ res <- as.SpatialPolygons.PolygonsList(Srl, proj4string=proj4string)
+ res
+}
+
diff --git a/R/subset.R b/R/subset.R
new file mode 100644
index 0000000..9ae4dba
--- /dev/null
+++ b/R/subset.R
@@ -0,0 +1,33 @@
+# Copyright 2003-5 (c) Roger Bivand
+
+subset.polylist <- function(x, subset, fit.bbox=TRUE, ...) {
+ .Deprecated("", package="maptools", msg="objects other than Spatial objects defined in the sp package are deprecated")
+ if (!inherits(x, "polylist")) stop("x not a polylist object")
+ if (!is.logical(subset)) stop("subset not a logical vector")
+ if (length(x) < 1) stop("zero length polylist")
+ if (length(x) != length(subset)) stop("x and subset different lengths")
+ res <- subset.default(x, subset)
+ attr(res, "region.id") <- subset.default(attr(x, "region.id"), subset)
+ old.ids <- 1:length(x)
+ new.ids <- match(old.ids, which(subset))
+ after <- new.ids[subset.default(attr(x, "after"), subset)]
+ area <- sapply(res, function(x) attr(x, "area"))
+ if (any(sapply(area, is.null)))
+ pO <- order(subset.default(attr(x, "plotOrder"), subset))
+ else pO <- order(area, decreasing=TRUE)
+
+ attr(res, "after") <- after
+ attr(res, "plotOrder") <- pO
+ class(res) <- "polylist"
+ attr(res, "maplim") <- attr(x, "maplim")
+ if (fit.bbox) attr(res, "maplim") <- maplimFromBbox(res)
+ res
+}
+
+maplimFromBbox <- function(plist) {
+ bboxes <- sapply(plist, function(x) attr(x, "bbox"))
+ mapxlim <- range(c(bboxes[c(1,3),]))
+ mapylim <- range(c(bboxes[c(2,4),]))
+ list(x=mapxlim, y=mapylim)
+}
+
diff --git a/R/sun-methods.R b/R/sun-methods.R
new file mode 100644
index 0000000..e3ec5e1
--- /dev/null
+++ b/R/sun-methods.R
@@ -0,0 +1,189 @@
+".balanceCrdsTimes" <- function(crds, dateTime)
+{
+ ## Value: list with crds and dateTime input matrices with equal number
+ ## of rows
+ ## --------------------------------------------------------------------
+ ## Arguments: crds=matrix with lon and lat; dateTime=matrix with year,
+ ## month, day, timezone, and dlstime rows, or a POSIXct time
+ ## --------------------------------------------------------------------
+ ncrds <- nrow(crds)
+ nTimes <- ifelse(is(dateTime, "POSIXct"), length(dateTime), nrow(dateTime))
+ if (ncrds == 1 && nTimes > 1) {
+ crds <- crds[rep(1, nTimes), ]
+ } else if (ncrds > 1 && nTimes == 1) {
+ dateTime <- if (is(dateTime, "POSIXct")) {
+ dateTime[rep(1, ncrds)]
+ } else dateTime[rep(1, ncrds), ]
+ } else if (ncrds != nTimes) {
+ stop("mismatch in number of coordinates and times")
+ }
+ list(crds=crds, dateTime=dateTime)
+}
+
+###_ crepuscule methods
+if (!isGeneric("crepuscule")) {
+ setGeneric("crepuscule", function(crds, dateTime, ...) {
+ standardGeneric("crepuscule")
+ })
+}
+
+setMethod("crepuscule",
+ signature(crds="SpatialPoints", dateTime="POSIXct"),
+ function(crds, dateTime, solarDep,
+ direction=c("dawn", "dusk"), POSIXct.out=FALSE) {
+ if (!isTRUE(!is.projected(crds)))
+ stop("crds must be geographical coordinates")
+ if (missing(solarDep)) stop("solarDep must be given")
+ crdsmtx <- matrix(c(coordinates(crds)[, 1],
+ coordinates(crds)[, 2]), ncol=2)
+ eq.ll <- .balanceCrdsTimes(crdsmtx, dateTime)
+ time.ll <- .timeData(eq.ll$dateTime)
+ lon <- eq.ll$crds[, 1]
+ lat <- eq.ll$crds[, 2]
+ res <- .crepuscule(lon=lon, lat=lat, year=time.ll$year,
+ month=time.ll$month, day=time.ll$day,
+ timezone=time.ll$timezone,
+ dlstime=time.ll$dlstime,
+ solarDep=solarDep, direction=direction)
+ if (POSIXct.out) {
+ secs <- res * 86400
+ if (is.null(time.ll$tz)) Pct <- as.POSIXct(format(dateTime,
+ "%Y-%m-%d")) + secs
+ else Pct <- as.POSIXct(format(dateTime, "%Y-%m-%d"),
+ tz=time.ll$tz) + secs
+ res <- data.frame(day_frac=res, time=Pct)
+ }
+ res
+ })
+
+setMethod("crepuscule", signature(crds="matrix", dateTime="POSIXct"),
+ function(crds, dateTime,
+ proj4string=CRS("+proj=longlat +datum=WGS84"), solarDep,
+ direction=c("dawn", "dusk"), POSIXct.out=FALSE) {
+ crds.sp <- SpatialPoints(crds, proj4string=proj4string)
+ crepuscule(crds.sp, dateTime=dateTime, solarDep=solarDep,
+ direction=direction, POSIXct.out=POSIXct.out)
+ })
+
+###_ sunriset methods
+if (!isGeneric("sunriset")) {
+ setGeneric("sunriset", function(crds, dateTime, ...) {
+ standardGeneric("sunriset")
+ })
+}
+
+setMethod("sunriset", signature(crds="SpatialPoints", dateTime="POSIXct"),
+ function(crds, dateTime, direction=c("sunrise", "sunset"),
+ POSIXct.out=FALSE) {
+ if (!isTRUE(!is.projected(crds)))
+ stop("crds must be geographical coordinates")
+ crdsmtx <- matrix(c(coordinates(crds)[, 1],
+ coordinates(crds)[, 2]), ncol=2)
+ eq.ll <- .balanceCrdsTimes(crdsmtx, dateTime)
+ time.ll <- .timeData(eq.ll$dateTime)
+ lon <- eq.ll$crds[, 1]
+ lat <- eq.ll$crds[, 2]
+ res <- .sunriset(lon=lon, lat=lat, year=time.ll$year,
+ month=time.ll$month, day=time.ll$day,
+ timezone=time.ll$timezone,
+ dlstime=time.ll$dlstime,
+ direction=direction)
+ if (POSIXct.out) {
+ secs <- res * 86400
+ if (is.null(time.ll$tz)) Pct <- as.POSIXct(format(dateTime,
+ "%Y-%m-%d")) + secs
+ else Pct <- as.POSIXct(format(dateTime, "%Y-%m-%d"),
+ tz=time.ll$tz) + secs
+ res <- data.frame(day_frac=res, time=Pct)
+ }
+ res
+ })
+
+setMethod("sunriset", signature(crds="matrix", dateTime="POSIXct"),
+ function(crds, dateTime,
+ proj4string=CRS("+proj=longlat +datum=WGS84"),
+ direction=c("sunrise", "sunset"), POSIXct.out=FALSE) {
+ crds.sp <- SpatialPoints(crds, proj4string=proj4string)
+ sunriset(crds.sp, dateTime=dateTime,
+ direction=direction, POSIXct.out=POSIXct.out)
+ })
+
+###_ solarnoon methods
+if (!isGeneric("solarnoon")) {
+ setGeneric("solarnoon", function(crds, dateTime, ...) {
+ standardGeneric("solarnoon")
+ })
+}
+
+setMethod("solarnoon", signature(crds="SpatialPoints", dateTime="POSIXct"),
+ function(crds, dateTime, POSIXct.out=FALSE) {
+ if (!isTRUE(!is.projected(crds)))
+ stop("crds must be geographical coordinates")
+ crdsmtx <- matrix(c(coordinates(crds)[, 1],
+ coordinates(crds)[, 2]), ncol=2)
+ eq.ll <- .balanceCrdsTimes(crdsmtx, dateTime)
+ time.ll <- .timeData(eq.ll$dateTime)
+ lon <- eq.ll$crds[, 1]
+ lat <- eq.ll$crds[, 2]
+ res <- .solarnoon(lon=lon, lat=lat, year=time.ll$year,
+ month=time.ll$month, day=time.ll$day,
+ timezone=time.ll$timezone,
+ dlstime=time.ll$dlstime)
+ if (POSIXct.out) {
+ secs <- res * 86400
+ if (is.null(time.ll$tz)) Pct <- as.POSIXct(format(dateTime,
+ "%Y-%m-%d")) + secs
+ else Pct <- as.POSIXct(format(dateTime, "%Y-%m-%d"),
+ tz=time.ll$tz) + secs
+ res <- data.frame(day_frac=res, time=Pct)
+ }
+ res
+ })
+
+setMethod("solarnoon", signature(crds="matrix", dateTime="POSIXct"),
+ function(crds, dateTime,
+ proj4string=CRS("+proj=longlat +datum=WGS84"),
+ POSIXct.out=FALSE) {
+ crds.sp <- SpatialPoints(crds, proj4string=proj4string)
+ solarnoon(crds.sp, dateTime=dateTime,
+ POSIXct.out=POSIXct.out)
+ })
+
+###_ solarpos methods
+if (!isGeneric("solarpos")) {
+ setGeneric("solarpos", function(crds, dateTime, ...) {
+ standardGeneric("solarpos")
+ })
+}
+
+setMethod("solarpos", signature(crds="SpatialPoints", dateTime="POSIXct"),
+ function(crds, dateTime, ...) {
+ if (!isTRUE(!is.projected(crds)))
+ stop("crds must be geographical coordinates")
+ crdsmtx <- matrix(c(coordinates(crds)[, 1],
+ coordinates(crds)[, 2]), ncol=2)
+ eq.ll <- .balanceCrdsTimes(crdsmtx, dateTime)
+ time.ll <- .timeData(eq.ll$dateTime)
+ lon <- eq.ll$crds[, 1]
+ lat <- eq.ll$crds[, 2]
+ res <- .solarpos(lon=lon, lat=lat, year=time.ll$year,
+ month=time.ll$month, day=time.ll$day,
+ hours=time.ll$hour, minutes=time.ll$min,
+ seconds=time.ll$sec, timezone=time.ll$timezone,
+ dlstime=time.ll$dlstime)
+ matrix(c(azimuth=res[,1], elevation=res[,2]), ncol=2)
+ })
+
+setMethod("solarpos", signature(crds="matrix", dateTime="POSIXct"),
+ function(crds, dateTime,
+ proj4string=CRS("+proj=longlat +datum=WGS84"), ...) {
+ crds.sp <- SpatialPoints(crds, proj4string=proj4string)
+ solarpos(crds.sp, dateTime=dateTime)
+ })
+
+
+###_* Emacs local variables.
+## Local variables:
+## allout-widgets-mode-inhibit: t
+## allout-layout: (-2 : 0)
+## End:
diff --git a/R/sun.R b/R/sun.R
new file mode 100644
index 0000000..0c6ebd5
--- /dev/null
+++ b/R/sun.R
@@ -0,0 +1,512 @@
+".deg" <- function(radian) 180 * radian / pi
+".rad" <- function(degree) pi * degree / 180
+
+".julianD" <- function(year, month, day)
+{
+ ## Value: Numeric Julian day without fractions.
+ ## --------------------------------------------------------------------
+ ## Arguments: year=4-digit year, month=1-12, day=1-31, all integers.
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ corr <- month <= 2
+ year[corr] <- year[corr] - 1
+ month[corr] <- month[corr] + 12
+ a <- floor(year / 100)
+ b <- 2 - a + floor(a / 4)
+ floor(365.25 * (year + 4716)) + floor(30.6001 * (month + 1)) +
+ day + b - 1524.5
+}
+
+## Takes Julian day and returns centuries since J2000.0
+".cent2000JD" <- function(jd) (jd - 2451545) / 36525
+
+## Takes number of centuries since J2000.0 and returns julian day
+".julianD2000" <- function(jc) jc * 36525 + 2451545
+
+".geomMeanLonSun" <- function(jc)
+{
+ ## Value: The geometric mean longitude of the sun in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ l0 <- 280.46646 + jc * (36000.76983 + 0.0003032 * jc)
+ updown <- !is.finite(l0) | l0 > 360 | l0 < 0
+ l0[updown] <- l0[updown] %% 360
+ l0
+}
+
+".geomMeanAnomSun" <- function(jc)
+{
+ ## Value: Numeric, geometric mean anomaly of the sun in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ 357.52911 + jc * (35999.05029 - 1.537e-4 * jc)
+}
+
+".eccentrEarthOrb" <- function(jc)
+{
+ ## Value: Numeric, unitless eccentricity of the Earth's orbit.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ 0.016708634 - jc * (4.2037e-5 + 1.267e-7 * jc)
+}
+
+".sunEqCenter" <- function(jc)
+{
+ ## Value: Numeric, position of the center of the sun in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ m <- .geomMeanAnomSun(jc)
+ mrad <- .rad(m)
+ sinm <- sin(mrad)
+ sin2m <- sin(mrad * 2)
+ sin3m <- sin(mrad * 3)
+ sinm * (1.914602 - jc * (4.817e-3 + 1.4e-5 * jc)) + sin2m *
+ (1.9993e-2 - 1.01e-4 * jc) + sin3m * 2.89e-4
+}
+
+".sunTrueLon" <- function(jc)
+{
+ ## Value: Numeric, sun's true longitude in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ l0 <- .geomMeanLonSun(jc)
+ eqc <- .sunEqCenter(jc)
+ l0 + eqc
+}
+
+".sunTrueAnom" <- function(jc)
+{
+ ## Value: Numeric, sun's true anomaly in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ m <- .geomMeanAnomSun(jc)
+ eqc <- .sunEqCenter(jc)
+ m + eqc
+}
+
+".sunRadVec" <- function(jc)
+{
+ ## Value: Numeric, sun's radius vector in AUs.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ v <- .sunTrueAnom(jc)
+ eo <- .eccentrEarthOrb(jc)
+ (1.000001018 * (1 - eo * eo)) / (1 + eo * cos(.rad(v)))
+}
+
+".sunApparentLon" <- function(jc)
+{
+ ## Value: Numeric, sun's apparent longitude in degrees
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ tl <- .sunTrueLon(jc)
+ om <- 125.04 - 1934.136 * jc
+ tl - 0.00569 - 0.00478 * sin(.rad(om))
+}
+
+".meanObliqEcliptic" <- function(jc)
+{
+ ## Value: Numeric, mean obliquity of the ecliptic in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ s <- 21.448 - jc * (46.815 + jc * (5.9e-4 - jc * 0.001813))
+ 23 + (26 + (s / 60)) / 60
+}
+
+".obliqCorr" <- function(jc)
+{
+ ## Value: Numeric, the corrected obliquity of the ecliptic in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ e0 <- .meanObliqEcliptic(jc)
+ om <- 125.04 - 1934.136 * jc
+ e0 + 0.00256 * cos(.rad(om))
+}
+
+".sunRtAscension" <- function(jc)
+{
+ ## Value: Numeric, the sun's right ascension in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ e0ok <- .obliqCorr(jc)
+ la <- .sunApparentLon(jc)
+ tananum <- cos(.rad(e0ok)) * sin(.rad(la))
+ tanadenom <- cos(.rad(la))
+ .deg(atan2(tananum, tanadenom))
+}
+
+".sunDeclination" <- function(jc)
+{
+ ## Value: Numeric, sun's declination in degrees.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ e0ok <- .obliqCorr(jc)
+ la <- .sunApparentLon(jc)
+ sinjc <- sin(.rad(e0ok)) * sin(.rad(la))
+ .deg(asin(sinjc))
+}
+
+".eqTime" <- function(jc)
+{
+ ## Value: Numeric, equation of the difference between true solar and
+ ## mean solar times.
+ ## --------------------------------------------------------------------
+ ## Arguments: jc=number of centuries since J2000.0
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ epsi <- .obliqCorr(jc)
+ l0 <- .geomMeanLonSun(jc)
+ ecc <- .eccentrEarthOrb(jc)
+ m <- .geomMeanAnomSun(jc)
+ y <- tan(.rad(epsi) / 2) ^ 2
+ sin2l0 <- sin(2 * .rad(l0))
+ sinm <- sin(.rad(m))
+ cos2l0 <- cos(2 * .rad(l0))
+ sin4l0 <- sin(4 * .rad(l0))
+ sin2m <- sin(2 * .rad(m))
+ etime <- y * sin2l0 - 2 * ecc * sinm + 4 * ecc * y * sinm * cos2l0 -
+ 0.5 * y * y * sin4l0 - 1.25 * ecc * ecc * sin2m
+ .deg(etime) * 4
+}
+
+".hangleCrepuscule" <- function(lat, solarDec, solarDep,
+ direction=c("dawn", "dusk"))
+{
+ ## Value: Numeric, hour angle of the sun at dawn or dusk in radians.
+ ## --------------------------------------------------------------------
+ ## Arguments: solarDec=declination angle of the sun in degrees;
+ ## solarDep=angle of the sun below the horizon in degrees;
+ ## dawn=logical indicating whether dawn or dusk hour angle should be
+ ## returned.
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ latrad <- .rad(lat)
+ sdrad <- .rad(solarDec)
+ haarg <- (cos(.rad(90 + solarDep)) / (cos(latrad) * cos(sdrad)) -
+ tan(latrad) * tan(sdrad))
+ haarg[abs(haarg) >= 1] <- NA
+ angle <- acos(haarg)
+ switch(direction, dawn=angle, dusk=-angle)
+}
+
+".hangleSunriset" <- function(lat, solarDec, direction=c("sunrise", "sunset"))
+{
+ ## Value: Numeric, hour angle of the sun at sunrise or sunset in
+ ## radians.
+ ## --------------------------------------------------------------------
+ ## Arguments: lat=numeric, latitude of observer in degrees;
+ ## solarDec=declination angle of the sun in degrees;
+ ## sunrise=logical indicating whether sunrise or sunset hour angle
+ ## should be returned.
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ latrad <- .rad(lat)
+ sdrad <- .rad(solarDec)
+ haarg <- (cos(.rad(90.833)) / (cos(latrad) * cos(sdrad)) -
+ tan(latrad) * tan(sdrad))
+ haarg[abs(haarg) >= 1] <- NA
+ angle <- acos(haarg)
+ switch(direction, sunrise= angle, sunset=-angle)
+}
+
+".crepusculeUTC" <- function(jd, lon, lat, solarDep,
+ direction=c("dawn", "dusk"))
+{
+ ## Value: Numeric, UTC time of dawn or dusk, in minutes from zero Z.
+ ## --------------------------------------------------------------------
+ ## Arguments: jd=julian day (real);
+ ## lon=lat=longitude and latitude, respectively, of the observer in
+ ## degrees;
+ ## solarDep=angle of the sun below the horizon in degrees;
+ ## dawn=logical indicating whether dawn or dusk UTC should be
+ ## returned.
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ jc <- .cent2000JD(jd)
+ eqtime <- .eqTime(jc)
+ solarDec <- .sunDeclination(jc)
+ switch(direction,
+ dawn = hourangle <- .hangleSunriset(lat, solarDec, dir="sunrise"),
+ dusk = hourangle <- .hangleSunriset(lat, solarDec, dir="sunset"))
+ d <- lon - .deg(hourangle)
+ tdiff <- 4 * d
+ timeUTC <- 720 + tdiff - eqtime
+ newt <- .cent2000JD(.julianD2000(jc) + timeUTC / 1440)
+ eqtime <- .eqTime(newt)
+ solarDec <- .sunDeclination(newt)
+ switch(direction,
+ dawn = {
+ hourangle <- .hangleCrepuscule(lat, solarDec, solarDep,
+ dir="dawn")},
+ dusk = {
+ hourangle <- .hangleCrepuscule(lat, solarDec, solarDep,
+ dir="dusk")})
+ d <- lon - .deg(hourangle)
+ tdiff <- 4 * d
+ 720 + tdiff - eqtime
+}
+
+".sunrisetUTC" <- function(jd, lon, lat, direction=c("sunrise", "sunset"))
+{
+ ## Value: Numeric, UTC time of sunrise or sunset, in minutes from zero
+ ## Z.
+ ## --------------------------------------------------------------------
+ ## Arguments: jd=julian day (real);
+ ## lon=lat=longitude and latitude, respectively, of the observer in
+ ## degrees;
+ ## sunrise=logical indicating whether sunrise or sunset UTC should be
+ ## returned.
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ jc <- .cent2000JD(jd)
+ eqtime <- .eqTime(jc)
+ solarDec <- .sunDeclination(jc)
+ switch(direction,
+ sunrise = hourangle <- .hangleSunriset(lat, solarDec, dir="sunrise"),
+ sunset = hourangle <- .hangleSunriset(lat, solarDec, dir="sunset"))
+ d <- lon - .deg(hourangle)
+ tdiff <- 4 * d
+ timeUTC <- 720 + tdiff - eqtime
+ newt <- .cent2000JD(.julianD2000(jc) + timeUTC / 1440)
+ eqtime <- .eqTime(newt)
+ solarDec <- .sunDeclination(newt)
+ switch(direction,
+ sunrise = hourangle <- .hangleSunriset(lat, solarDec, dir="sunrise"),
+ sunset = hourangle <- .hangleSunriset(lat, solarDec, dir="sunset"))
+ d <- lon - .deg(hourangle)
+ tdiff <- 4 * d
+ 720 + tdiff - eqtime
+}
+
+".redoLonLat" <- function(lon, lat)
+{
+ ## Value: Matrix of latitude and longitude with + N, + W values, and
+ ## with latitudes < -89.8 or > 89.8 fixed to -89.8 and 89.8,
+ ## respectively.
+ ## --------------------------------------------------------------------
+ ## Arguments: lon=lat=longitude and latitude, respectively, in degrees
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ newlon <- -lon
+ newlat <- lat
+ newlat[newlat > 89.8] <- 89.8
+ newlat[newlat < -89.8] <- -89.8
+ cbind(newlon, newlat)
+}
+
+".timeData" <- function(time)
+{
+ ## Value: list with numeric vectors year, month, day, offset hours
+ ## from GMT, and whether day light savings is in effect.
+ ## --------------------------------------------------------------------
+ ## Arguments: time=POSIXct
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian P. Luque
+ ## --------------------------------------------------------------------
+ time.gmt <- as.POSIXct(format(time), tz="GMT")
+ time.plt <- as.POSIXlt(time)
+ timezone <- as.numeric(difftime(time.gmt, time, units="hours"))
+ year <- as.integer(format(time.plt, "%Y"))
+ month <- as.integer(format(time.plt, "%m"))
+ day <- as.integer(format(time.plt, "%d"))
+ hour <- as.integer(format(time.plt, "%H"))
+ min <- as.integer(format(time.plt, "%M"))
+ sec <- as.integer(format(time.plt, "%S"))
+ list(year=year, month=month, day=day, hour=hour, min=min, sec=sec,
+ timezone=timezone, dlstime=0, tz=attr(time, "tzone"))
+}
+
+".crepuscule" <- function(lon, lat, year, month, day, timezone,
+ dlstime, solarDep, direction=c("dawn", "dusk"))
+{
+ ## Value: Numeric, time of dawn in local time (days)
+ ## --------------------------------------------------------------------
+ ## Arguments: lon=lat=longitude and latitude of the observer in degrees;
+ ## year=4-digit year; month=1-12; day=1-31;
+ ## timezone=time zone hours shift relative to UTC (hours);
+ ## dlstime=1 or 0 to indicate daylight savings time or not;
+ ## solarDep=angle of the sun below the horizon in degrees;
+ ## dawn=logical to indicate whether dawn or dusk time should be
+ ## returned
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ ll <- .redoLonLat(lon, lat)
+ jd <- .julianD(year, month, day)
+ switch(direction,
+ dawn = {
+ risetTimeGMT <- .crepusculeUTC(jd, ll[, 1], ll[, 2], solarDep,
+ dir="dawn")},
+ dusk = {
+ risetTimeGMT <- .crepusculeUTC(jd, ll[, 1], ll[, 2], solarDep,
+ dir="dusk")})
+ risetTimeLST <- risetTimeGMT + (60 * timezone) + (dlstime * 60)
+ risetTimeLST / 1440
+}
+
+".sunriset" <- function(lon, lat, year, month, day, timezone,
+ dlstime, direction=c("sunrise", "sunset"))
+{
+ ## Value: Numeric, time of sunrise in local time (days)
+ ## --------------------------------------------------------------------
+ ## Arguments: lon=lat=longitude and latitude of the observer in degrees;
+ ## year=4-digit year; month=1-12; day=1-31;
+ ## timezone=time zone hours shift relative to UTC (hours);
+ ## dlstime=1 or 0 to indicate daylight savings time or not;
+ ## sunrise=logical to indicate whether sunrise or sunset time should
+ ## be returned
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ ll <- .redoLonLat(lon, lat)
+ jd <- .julianD(year, month, day)
+ switch(direction,
+ sunrise = {
+ risetTimeGMT <- .sunrisetUTC(jd, ll[, 1], ll[, 2],
+ dir="sunrise")},
+ sunset = {
+ risetTimeGMT <- .sunrisetUTC(jd, ll[, 1], ll[, 2],
+ dir="sunset")})
+ risetTimeLST <- risetTimeGMT + (60 * timezone) + (dlstime * 60)
+ risetTimeLST / 1440
+}
+
+".solarnoon" <- function(lon, lat, year, month, day, timezone, dlstime)
+{
+ ## Value: Numeric, time of solar noon in local time (days)
+ ## --------------------------------------------------------------------
+ ## Arguments: lon=lat=longitude and latitude of the observer in degrees;
+ ## year=4-digit year; month=1-12; day=1-31;
+ ## timezone=time zone hours shift relative to UTC (hours);
+ ## dlstime=1 or 0 to indicate daylight savings time or not;
+ ## solarDep=angle of the sun below the horizon in degrees
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ ll <- .redoLonLat(lon, lat)
+ jd <- .julianD(year, month, day)
+ jc <- .cent2000JD(jd)
+ newt <- .cent2000JD(.julianD2000(jc) + 0.5 + ll[, 1] / 360)
+ eqtime <- .eqTime(newt)
+# solarNoonDec <- .sunDeclination(newt)
+ solNoonUTC <- 720 + (ll[, 1] * 4) - eqtime
+ solarnoon <- solNoonUTC + (60 * timezone) + (dlstime * 60)
+ solarnoon / 1440
+}
+
+".solarpos" <- function(lon, lat, year, month, day, hours, minutes,
+ seconds, timezone, dlstime)
+{
+ ## Value: matrix with solar azimuth (in degrees from N) and solar
+ ## elevation.
+ ## --------------------------------------------------------------------
+ ## Arguments: lon=lat=longitude and latitude of the observer in
+ ## degrees; year=4-digit year; month=1-12; day=1-31; hours=0-23;
+ ## minutes=0-59; seconds=0-59; timezone=time zone hours shift
+ ## relative to UTC (hours); dlstime=1 or 0 to indicate daylight
+ ## savings time or not;
+ ## --------------------------------------------------------------------
+ ## Author: Sebastian Luque
+ ## --------------------------------------------------------------------
+ ll <- .redoLonLat(lon, lat)
+ zone <- -timezone
+ hh <- hours - ((dlstime * 60) / 60)
+ timenow <- hh + minutes / 60 + seconds / 3600 + zone
+ jd <- .julianD(year, month, day)
+ jc <- .cent2000JD(jd + timenow / 24)
+# earthRadVec <- r <- .sunRadVec(jc)
+ solarDec <- .sunDeclination(jc)
+ eqtime <- .eqTime(jc)
+ solarTimefix <- eqtime - 4 * ll[, 1] + 60 * zone
+ trueSolarTime <- hh * 60 + minutes + seconds / 60 + solarTimefix
+ corrsol <- trueSolarTime > 1440
+ trueSolarTime[corrsol] <- trueSolarTime[corrsol] %% 1440
+ hourangle <- trueSolarTime / 4 - 180
+ hourangle[hourangle < -180] <- hourangle[hourangle < -180] + 360
+ harad <- .rad(hourangle)
+ csz <- sin(.rad(ll[, 2])) * sin(.rad(solarDec)) + cos(.rad(ll[, 2])) *
+ cos(.rad(solarDec)) * cos(harad)
+ csz[csz > 1] <- 1
+ csz[csz < -1] <- -1
+ zenith <- .deg(acos(csz))
+ azDenom <- cos(.rad(ll[, 2])) * sin(.rad(zenith))
+ azimuth <- numeric(length(azDenom))
+ hiaD <- abs(azDenom) > 0.001 # if (Abs(azDenom) > 0.001) ... BEG
+ azRad <- ((sin(.rad(ll[hiaD, 2])) * cos(.rad(zenith[hiaD]))) -
+ sin(.rad(solarDec))) / azDenom[hiaD]
+ zz <- abs(azRad) > 1 # if (Abs(azRad) > 1) ... BEG
+ azRad[zz & azRad < 0] <- -1 # if (azRad < 0) ... BEG
+ azRad[zz & !azRad < 0] <- 1 # if (azRad < 0) ... END
+ # if (Abs(azRad) > 1) ... END
+ azimuth1 <- 180 - .deg(acos(azRad))
+ zz <- hourangle[hiaD] > 0 # if (hourangle > 0) ... BEG
+ azimuth1[zz] <- -azimuth1[zz] # if (hourangle > 0) ... END
+ azimuth[hiaD] <- azimuth1
+ loaD <- !hiaD
+ azimuth[loaD & ll[, 2] > 0] <- 180 # if (latitude > 0) ... BEG
+ azimuth[loaD & !ll[, 2] > 0] <- 0 # if (latitude > 0) ... END
+ # if (Abs(azDenom) > 0.001) ... END
+ azimuth[azimuth < 0] <- azimuth[azimuth < 0] + 360
+ exoatmEl <- 90 - zenith
+ refracCorr <- numeric(length(exoatmEl))
+ hiR <- exoatmEl > 85 # if (exoatmElevation > 85) ... BEG
+ refracCorr[hiR] <- 0
+ loR <- !hiR
+ zz <- loR & exoatmEl > 5
+ te <- tan(.rad(exoatmEl[zz]))
+ refracCorr[zz] <- 58.1 / te - 0.07 / (te^3) + 8.6e-5 / te^5
+ zz <- loR & !exoatmEl > 5 & exoatmEl > -0.575
+ step1 <- -12.79 + exoatmEl[zz] * 0.711
+ step2 <- 103.4 + exoatmEl[zz] * step1
+ step3 <- -518.2 + exoatmEl[zz] * step2
+ refracCorr[zz] <- 1735 + exoatmEl[zz] * step3
+ zz <- loR & !exoatmEl > 5 & !exoatmEl > -0.575
+ te <- tan(.rad(exoatmEl[zz]))
+ refracCorr[zz] <- -20.774 / te
+ refracCorr <- refracCorr / 3600
+ solarzen <- zenith - refracCorr
+ cbind(azimuth=azimuth, elevation=90 - solarzen)
+}
diff --git a/R/union.R b/R/union.R
new file mode 100644
index 0000000..c59f140
--- /dev/null
+++ b/R/union.R
@@ -0,0 +1,58 @@
+unionSpatialPolygons <- function(SpP, IDs, threshold=NULL) {
+ require(gpclib)
+ if (!is(SpP, "SpatialPolygons")) stop("not a SpatialPolygons object")
+ pl <- slot(SpP, "polygons")
+ proj4CRS <- CRS(proj4string(SpP))
+ SrnParts <- sapply(pl, function(x) length(slot(x, "Polygons")))
+ if (missing(IDs)) stop("IDs required")
+ if (length(pl) != length(IDs)) stop("input lengths differ")
+ tab <- table(factor(IDs))
+ n <- length(tab)
+ IDss <- names(tab)
+ reg <- match(IDs, IDss)
+ belongs <- lapply(1:n, function(x) which(x == reg))
+ Srl <- vector(mode="list", length=n)
+ for (i in 1:n) {
+ ii <- belongs[[i]]
+ nParts <- length(ii)
+ if (nParts == 1) {
+ Srl[[i]] <- Polygons(
+ slot(pl[[ii[1]]], "Polygons"),
+ ID=IDss[i])
+ } else {
+ nPi <- SrnParts[belongs[[i]]]
+ m <- sum(nPi)
+ pli <- vector(mode="list", length=m)
+ jj <- 1
+ for (j in 1:nParts) {
+ SrSrj <- slot(pl[[ii[j]]], "Polygons")
+ for (k in 1:nPi[j]) {
+ pli[[jj]] <- slot(SrSrj[[k]], "coords")
+ if (jj <= m) jj <- jj + 1
+ else stop("jj out of range")
+ }
+ }
+ iin <- length(pli)
+ resi <- as(pli[[1]], "gpc.poly")
+ for (j in 2:iin)
+ resi <- gpclib:::union(resi, as(pli[[j]], "gpc.poly"))
+ if (!is.null(threshold)) {
+ areas <- sapply(resi at pts, function(x) {
+ area.poly(as(cbind(x$x, x$y), "gpc.poly"))})
+ resi at pts <- resi at pts[areas > threshold]
+ }
+ nP <- length(resi at pts)
+ Srli <- vector(mode="list", length=nP)
+ for (j in 1:nP) {
+ crds <- cbind(resi at pts[[j]]$x, resi at pts[[j]]$y)
+ crds <- rbind(crds, crds[1,])
+ hole <- resi at pts[[j]]$hole
+ Srli[[j]] <- Polygon(coords=crds, hole=hole)
+ }
+ Srl[[i]] <- Polygons(Srli, ID=IDss[i])
+ }
+ }
+ res <- as.SpatialPolygons.PolygonsList(Srl, proj4string=proj4CRS)
+ res
+}
+
diff --git a/R/zzz.R b/R/zzz.R
new file mode 100644
index 0000000..e09463a
--- /dev/null
+++ b/R/zzz.R
@@ -0,0 +1,8 @@
+#.First.lib <- function(lib, pkg) {
+# library.dynam("maptools", pkg, lib)
+#}
+## .noGenerics <- TRUE
+#maptools()
+
+".onLoad" <- function(lib, pkg) require(methods)
+
diff --git a/data/gpcholes.rda b/data/gpcholes.rda
new file mode 100644
index 0000000..f4aad6b
Binary files /dev/null and b/data/gpcholes.rda differ
diff --git a/data/wrld_simpl.rda b/data/wrld_simpl.rda
new file mode 100644
index 0000000..3314ca6
Binary files /dev/null and b/data/wrld_simpl.rda differ
diff --git a/inst/ChangeLog b/inst/ChangeLog
new file mode 100644
index 0000000..ae93186
--- /dev/null
+++ b/inst/ChangeLog
@@ -0,0 +1,606 @@
+2009-02-18 12:58 rsbivand
+
+ * inst/shapes/fylk-val-ll.dbf, inst/shapes/fylk-val-ll.shp,
+ inst/shapes/fylk-val-ll.shx, data/wrld_simpl.rda: kml writing;
+ GSHHS lines shift
+
+2009-02-18 12:55 rsbivand
+
+ * ChangeLog, DESCRIPTION, INDEX, NAMESPACE, R/Rgshhs.R,
+ inst/ChangeLog, inst/LICENSE, inst/share/gshhs_c.b,
+ man/Rgshhs.Rd, R/getKMLcoordinates.R, R/kmlLine.R,
+ R/kmlPolygon.R, man/getKMLcoordinates.Rd, man/kmlLine.Rd,
+ man/kmlPolygon.Rd, man/wrld_simpl.Rd: kml writing; GSHHS lines
+ shift
+
+2009-02-05 18:45 rsbivand
+
+ * man/asciigrid.Rd: tidy
+
+2009-02-05 16:38 rsbivand
+
+ * R/readSplus.R, man/sp2WB.Rd, ChangeLog, inst/ChangeLog: adding
+ features to readSplus
+
+2009-02-05 14:38 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/readSplus.R, inst/share/Splus.map,
+ man/readSplus.Rd, ChangeLog, inst/ChangeLog: adding readSplus for
+ WinBUGS
+
+2009-01-20 15:38 rsbivand
+
+ * DESCRIPTION, R/sun-methods.R, ChangeLog, inst/ChangeLog: sun NULL
+ tz
+
+2008-11-13 15:06 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/readGPS.R, inst/ChangeLog,
+ man/readGPS.Rd: ... for readGPS()
+
+2008-11-12 15:55 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SP2owin.R, R/sp_spat1.R, R/spatstat1.R,
+ man/as.ppp.Rd, man/ppp.Rd: as.psp
+
+2008-10-02 16:46 rsbivand
+
+ * ChangeLog, inst/ChangeLog: changelog
+
+2008-08-14 11:09 rsbivand
+
+ * DESCRIPTION, INDEX, R/spmaps.R: NULL bug in maps2SP
+
+2008-06-27 10:15 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SpatialLines-methods.R,
+ R/SpatialPoints-methods.R, R/SpatialPolys-methods.R,
+ R/maptools.R, R/pcent.R, R/readGPS.R, R/shapelib.R, R/subset.R,
+ inst/changes, man/readShapePoly.Rd, R/Spatial-methods.R,
+ man/readShapeSpatial.Rd, ChangeLog, inst/ChangeLog: readSpatial
+ wrapper
+
+2008-06-19 07:56 rsbivand
+
+ * DESCRIPTION, R/sp2pbs.R: PolySet2SpatialLines UTM zone update
+
+2008-05-24 19:18 rsbivand
+
+ * ChangeLog, INDEX, inst/ChangeLog: GSHHS support to 1.10
+
+2008-05-24 18:27 rsbivand
+
+ * DESCRIPTION, R/Rgshhs.R, R/sp2pbs.R, inst/share/gshhs_c.b,
+ inst/share/wdb_borders_c.b, man/Rgshhs.Rd, src/Rgshhs.c,
+ src/Rgshhs.h: GSHHS support to 1.10
+
+2008-04-14 22:49 rsbivand
+
+ * DESCRIPTION: tidy
+
+2008-04-14 22:35 rsbivand
+
+ * ChangeLog, inst/ChangeLog: tidy
+
+2008-04-14 22:33 rsbivand
+
+ * DESCRIPTION: PolySet
+
+2008-04-13 18:47 rsbivand
+
+ * DESCRIPTION, INDEX, R/sp2pbs.R: PBS to SP SID bug
+
+2008-04-10 16:07 rsbivand
+
+ * man/readShapePoly.Rd: tidy
+
+2008-04-04 19:59 rsbivand
+
+ * DESCRIPTION, R/SpatialPolys-methods.R, man/readShapePoly.Rd: ABS
+ nulls
+
+2008-03-30 21:48 rsbivand
+
+ * DESCRIPTION, R/Rgshhs.R, man/Rgshhs.Rd: GSHHS clip
+
+2008-03-03 22:47 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/GE_png.R, R/shapelib.R, inst/ChangeLog,
+ man/GE_SpatialGrid.Rd, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd: makegrid
+
+2008-02-09 13:42 rsbivand
+
+ * DESCRIPTION, man/Rgshhs.Rd, man/SpatialLines2PolySet.Rd,
+ man/checkPolygonsHoles.Rd, man/dotsInPolys.Rd,
+ man/gcDestination.Rd, man/map2SpatialPolygons.Rd,
+ man/nowrapRecenter.Rd, man/pal2SpatialPolygons.Rd,
+ man/plot.polylist.Rd, man/pointLabel.Rd, man/readGPS.Rd,
+ man/readShapeLines.Rd, man/readShapePoints.Rd,
+ man/readShapePoly.Rd, man/sp2WB.Rd, man/sp2tmap.Rd,
+ man/sun-methods.Rd, man/symbolsInPolys.Rd,
+ man/unionSpatialPolygons.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/write.polylistShape.Rd: line lengths
+ in help
+
+2008-01-30 21:53 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/GE_png.R, man/GE_SpatialGrid.Rd: SG
+ creation
+
+2008-01-30 09:26 rsbivand
+
+ * R/elide.R: ppp + getinfo
+
+2008-01-29 12:36 rsbivand
+
+ * R/elide.R: ppp + getinfo
+
+2008-01-29 12:00 rsbivand
+
+ * R/elide.R, man/elide-methods.Rd: ppp + getinfo
+
+2008-01-29 11:37 rsbivand
+
+ * R/: sp_spat1.R, spatstat1.R: ppp + getinfo
+
+2008-01-29 10:52 rsbivand
+
+ * R/shapelib.R, R/sp_spat1.R, src/Rshapeget.c, src/Rshapeinfo.c:
+ ppp + getinfo
+
+2008-01-29 10:03 rsbivand
+
+ * src/Rshapeinfo.c: ppp + getinfo
+
+2008-01-29 09:50 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/shapelib.R, R/sp_spat1.R,
+ R/spatstat1.R, src/Rshapeinfo.c: ppp + getinfo
+
+2008-01-20 16:08 rsbivand
+
+ * ChangeLog, DESCRIPTION, NAMESPACE, R/SpatialPolys-methods.R,
+ R/sp2pbs.R, inst/ChangeLog, man/SpatialLines2PolySet.Rd: pbs to
+ sp
+
+2007-12-13 18:32 rsbivand
+
+ * DESCRIPTION, R/elide.R: elide
+
+2007-12-09 19:03 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/elide.R, inst/ChangeLog,
+ man/elide-methods.Rd, src/Rgshhs.c, src/Rgshhs.h: elide shift
+
+2007-11-21 23:37 rsbivand
+
+ * R/elide.R: elide bug
+
+2007-11-16 10:12 rsbivand
+
+ * DESCRIPTION, inst/changes, inst/share/gshhs_c.b, man/Rgshhs.Rd,
+ src/Rgshhs.c, src/Rgshhs.h, src/shpopen.c: GSHHS to 1.5
+
+2007-11-10 14:17 rsbivand
+
+ * src/: shpopen.c, shptree.c: assert
+
+2007-10-31 16:43 rsbivand
+
+ * ChangeLog, R/sp2WB.R, inst/ChangeLog: thingy to slot
+
+2007-10-31 14:46 rsbivand
+
+ * ChangeLog, DESCRIPTION, R/SP2owin.R, R/SpatialLines-methods.R,
+ R/SpatialPolys-methods.R, R/checkHoles.R, R/dotsinpolys.R,
+ R/nowrapRecenter.R, R/sp2WB.R, R/sp2pbs.R, R/union.R,
+ inst/ChangeLog, inst/changes, man/checkPolygonsHoles.Rd,
+ man/dotsInPolys.Rd, man/gcDestination.Rd,
+ man/map2SpatialPolygons.Rd, man/pal2SpatialPolygons.Rd,
+ man/readShapePoly.Rd, man/symbolsInPolys.Rd,
+ man/unionSpatialPolygons.Rd: thingy to slot
+
+2007-10-23 14:50 rsbivand
+
+ * DESCRIPTION, LICENSE, inst/LICENSE, inst/changes,
+ man/Map2poly.Rd, man/as.ppp.Rd, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd: license
+
+2007-10-10 08:25 rsbivand
+
+ * ChangeLog, INDEX, inst/ChangeLog, inst/changes: tidy
+
+2007-10-06 19:38 rsbivand
+
+ * man/gcDestination.Rd: elide first cut
+
+2007-10-06 12:05 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/elide.R, R/gc_dist.R,
+ man/elide-methods.Rd: elide first cut
+
+2007-09-29 18:37 rsbivand
+
+ * R/pointLabel.R: pointLabel update
+
+2007-09-26 11:09 rsbivand
+
+ * R/asciigrid.R: Ascii Grid dec
+
+2007-09-18 10:19 rsbivand
+
+ * ChangeLog, inst/ChangeLog, inst/changes: tidy
+
+2007-09-18 10:15 rsbivand
+
+ * DESCRIPTION, R/maptools.R, R/sp2WB.R: tidy
+
+2007-09-14 22:14 rsbivand
+
+ * R/sp2Mondrian.R, man/sp2Mondrian.Rd: Mondrian new format
+
+2007-09-14 08:58 rsbivand
+
+ * DESCRIPTION, R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/shapelib.R, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd,
+ man/write.linelistShape.Rd, man/write.pointShape.Rd,
+ man/write.polylistShape.Rd: pass through max_nchar
+
+2007-09-05 18:07 rsbivand
+
+ * DESCRIPTION, R/spmaps.R, ChangeLog, inst/ChangeLog, inst/changes:
+ double NA at end of map coords
+
+2007-07-25 10:49 rsbivand
+
+ * man/write.polylistShape.Rd: 3D polylist, write line shape, owin
+ poly
+
+2007-07-19 21:33 rsbivand
+
+ * DESCRIPTION, R/SP2owin.R, R/maptools.R, R/shapelib.R,
+ inst/changes, man/as.ppp.Rd, man/write.linelistShape.Rd,
+ man/write.polylistShape.Rd, src/Rshapewrite1.c: 3D polylist
+ writing
+
+2007-06-11 10:05 rsbivand
+
+ * DESCRIPTION: encoding
+
+2007-06-10 23:27 rsbivand
+
+ * ChangeLog, INDEX, inst/ChangeLog, inst/changes, man/Map2poly.Rd,
+ man/sp2WB.Rd: encode
+
+2007-06-10 22:47 rsbivand
+
+ * ChangeLog, DESCRIPTION, NAMESPACE, R/pointLabel.R,
+ inst/ChangeLog, man/pointLabel.Rd: pointLabel
+
+2007-06-05 15:31 rsbivand
+
+ * INDEX, R/readGPS.R: con correction
+
+2007-05-08 18:35 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/sp_spat1.R, man/as.ppp.Rd: revert
+ spatstat coerce
+
+2007-05-07 10:55 rsbivand
+
+ * man/readGPS.Rd: tidy
+
+2007-04-28 21:41 rsbivand
+
+ * man/readShapePoints.Rd: doc error
+
+2007-04-27 18:37 rsbivand
+
+ * man/readGPS.Rd: resolve GPS conflict
+
+2007-04-21 06:27 rsbivand
+
+ * DESCRIPTION, INDEX, R/GE_png.R: GE dimnames
+
+2007-04-16 06:01 rsbivand
+
+ * man/readGPS.Rd: sp problem and gps
+
+2007-04-16 04:40 rsbivand
+
+ * DESCRIPTION, R/readGPS.R, R/spmaps.R, man/readGPS.Rd: sp problem
+ and gps
+
+2007-03-29 16:34 rsbivand
+
+ * inst/changes: tidy
+
+2007-03-23 18:50 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/plot.Map.R, R/readGPS.R,
+ man/readGPS.Rd: readGPS
+
+2007-02-09 21:09 rsbivand
+
+ * R/SpatialPolys-methods.R, man/readShapePoly.Rd: force_ring in
+ readShapePoly
+
+2007-02-01 15:28 rsbivand
+
+ * DESCRIPTION, INDEX, R/sun-methods.R, man/plot.Map.Rd,
+ man/plot.polylist.Rd, man/sun-methods.Rd: sun manual tidy
+
+2007-01-21 11:50 rsbivand
+
+ * man/: GE_SpatialGrid.Rd, kmlOverlay.Rd: GE_PNG additions
+
+2007-01-20 22:35 rsbivand
+
+ * DESCRIPTION, NAMESPACE, inst/changes, R/GE_png.R,
+ man/GE_SpatialGrid.Rd, man/kmlOverlay.Rd: GE_PNG additions
+
+2007-01-16 10:39 rsbivand
+
+ * INDEX: im and sun-methods
+
+2007-01-16 10:23 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/sp_spat1.R, inst/changes,
+ man/as.ppp.Rd, man/crepuscule-methods.Rd, man/ppp.Rd,
+ man/solarnoon-methods.Rd, man/solarpos-methods.Rd,
+ man/sun-methods.Rd, man/sunriset-methods.Rd: im and sun-methods
+
+2006-12-02 16:38 rsbivand
+
+ * DESCRIPTION, INDEX, man/solarnoon-methods.Rd: release
+
+2006-11-22 13:03 rsbivand
+
+ * R/Rgshhs.R: Rgshhs
+
+2006-11-16 15:34 rsbivand
+
+ * R/sp_bind.R, inst/share/nc_xtra.dbf, man/spCbind-methods.Rd,
+ man/spChFIDs-methods.Rd, man/spRbind-methods.Rd: bind
+
+2006-11-16 15:31 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/sp2pbs.R, man/Rgshhs.Rd,
+ man/map2SpatialPolygons.Rd, man/plot.polylist.Rd,
+ man/read.shape.Rd, man/subset.polylist.Rd, src/Rgshhs.c: bind
+
+2006-10-31 14:06 rsbivand
+
+ * NAMESPACE, R/SP2owin.R, R/sp_tools.R, R/sun.R, inst/changes,
+ inst/share/co37_d90.e00, inst/share/gshhs_c.b, R/Rgshhs.R,
+ R/checkHoles.R, R/nowrapRecenter.R, R/union.R, man/Rgshhs.Rd,
+ man/checkPolygonsHoles.Rd, man/nowrapRecenter.Rd,
+ man/pal2SpatialPolygons.Rd, man/unionSpatialPolygons.Rd,
+ src/Rgshhs.c, src/Rgshhs.h: sun and r-spatial integration
+
+2006-10-31 09:29 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/sun.R, R/zzz.R, R/SP2owin.R,
+ R/sp2pbs.R, R/sp_spat1.R, R/sp_tools.R, R/spatstat1.R,
+ R/spmaps.R, R/sun-methods.R, man/ContourLines2SLDF.Rd,
+ man/SpatialLines2PolySet.Rd, man/as.ppp.Rd,
+ man/crepuscule-methods.Rd, man/map2SpatialPolygons.Rd,
+ man/ppp.Rd, man/solarnoon-methods.Rd, man/solarpos-methods.Rd,
+ man/sun.Rd, man/sunriset-methods.Rd: sun and r-spatial
+ integration
+
+2006-10-29 14:53 rsbivand
+
+ * R/sun.R: sun ephemerides
+
+2006-10-28 21:56 rsbivand
+
+ * R/sun.R: sun ephemerides
+
+2006-10-28 19:23 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/sun.R, inst/changes, man/sun.Rd:
+ sun ephemerides
+
+2006-10-19 22:03 rsbivand
+
+ * DESCRIPTION, R/dotsinpolys.R, inst/changes: dostInPolys NULL
+
+2006-09-21 21:42 rsbivand
+
+ * DESCRIPTION: R 2.4.0
+
+2006-08-30 16:50 rsbivand
+
+ * DESCRIPTION, src/Rshapewrite1.c: pointZ
+
+2006-08-30 08:59 rsbivand
+
+ * DESCRIPTION, LICENSE, R/maptools.R, R/shapelib.R, inst/LICENSE,
+ inst/changes, man/readShapePoints.Rd, src/Rshapewrite.c,
+ inst/shapes/pointZ.dbf, inst/shapes/pointZ.prj,
+ inst/shapes/pointZ.shp, inst/shapes/pointZ.shx: pointZ
+
+2006-05-02 09:07 rsbivand
+
+ * DESCRIPTION, R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/shapelib.R, inst/changes,
+ man/read.shape.Rd, man/readShapeLines.Rd, man/readShapePoints.Rd,
+ man/readShapePoly.Rd, src/Rshapeget.c: Geolytics bug
+
+2006-04-10 21:21 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/asciigrid.R, R/azimuth.R, R/sp2WB.R,
+ inst/changes, man/asciigrid.Rd, man/dotsInPolys.Rd,
+ man/gzAzimuth.Rd: fix to sp2WB, readAsciiGrid, writeAsciiGrid
+
+2006-03-20 09:32 rsbivand
+
+ * DESCRIPTION, R/sp2Mondrian.R, man/sp2Mondrian.Rd: Mondrian
+
+2006-03-10 13:49 rsbivand
+
+ * DESCRIPTION, INDEX, NAMESPACE, R/asciigrid.R, R/sp2tmap.R,
+ inst/changes, man/asciigrid.Rd, man/sp2WB.Rd, R/azimuth.R,
+ R/sp2Mondrian.R, man/gzAzimuth.Rd, man/sp2Mondrian.Rd:
+ sp2Mondrian
+
+2006-03-01 09:53 rsbivand
+
+ * DESCRIPTION, INDEX, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/plot.Map.R, R/shapelib.R,
+ inst/changes, man/plot.Map.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/write.polylistShape.Rd,
+ src/Rshapeget.c: checks on polylists
+
+2006-01-11 12:08 rsbivand
+
+ * R/sp2tmap.R, man/sp2tmap.Rd: tmap
+
+2006-01-10 14:08 rsbivand
+
+ * R/sp2tmap.R, man/sp2tmap.Rd: tmap
+
+2006-01-09 14:33 rsbivand
+
+ * NAMESPACE, man/sp2tmap.Rd: sp2tmap
+
+2006-01-08 22:23 rsbivand
+
+ * man/sp2tmap.Rd: adding sp2tmap
+
+2006-01-08 19:34 rsbivand
+
+ * DESCRIPTION, R/sp2WB.R, R/sp2tmap.R, man/asciigrid.Rd,
+ man/sp2tmap.Rd: adding sp2tmap
+
+2005-12-15 16:00 rsbivand
+
+ * INDEX: to 5-4
+
+2005-12-12 22:27 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SpatialPoints-methods.R,
+ R/SpatialPolys-methods.R, R/shapelib.R, R/sp2WB.R, inst/changes,
+ man/readShapePoly.Rd, man/sp2WB.Rd, man/write.pointShape.Rd:
+ sp2WB
+
+2005-10-03 19:44 rsbivand
+
+ * DESCRIPTION, R/SpatialLines-methods.R, inst/changes: lines bugs
+
+2005-09-14 23:08 rsbivand
+
+ * R/SpatialPolys-methods.R: as at 0.5-2
+
+2005-09-13 19:24 rsbivand
+
+ * man/: dotsInPolys.Rd, symbolsInPolys.Rd: remove suggested splancs
+
+2005-09-13 16:53 rsbivand
+
+ * DESCRIPTION, R/dotsinpolys.R, man/dotsInPolys.Rd,
+ man/plot.Map.Rd, man/readShapePoly.Rd, man/symbolsInPolys.Rd:
+ remove suggested splancs
+
+2005-09-09 16:28 rsbivand
+
+ * R/plot.Map.R: ... in plot.Map
+
+2005-09-08 22:28 rsbivand
+
+ * INDEX, R/SpatialPolys-methods.R, R/dotsinpolys.R,
+ man/dotsInPolys.Rd: dotsinpolys begun
+
+2005-09-08 13:11 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/maptools.R, R/shapelib.R: codetools
+
+2005-09-05 14:54 rsbivand
+
+ * man/asciigrid.Rd: links
+
+2005-09-05 11:00 rsbivand
+
+ * DESCRIPTION, NAMESPACE, R/SpatialLines-methods.R,
+ R/SpatialPoints-methods.R, R/SpatialPolys-methods.R,
+ R/asciigrid.R, man/asciigrid.Rd, man/readShapeLines.Rd,
+ man/readShapePoints.Rd, man/readShapePoly.Rd,
+ man/read_ShapeLines.Rd, man/read_ShapePoints.Rd,
+ man/read_ShapePoly.Rd: removing _
+
+2005-09-03 18:19 rsbivand
+
+ * inst/changes, man/read_ShapeLines.Rd, man/read_ShapePoly.Rd:
+ added ... to degAxis()
+
+2005-09-02 09:40 rsbivand
+
+ * NAMESPACE, R/asciigrid.R, man/asciigrid.Rd: more asciigrid
+
+2005-09-01 20:26 rsbivand
+
+ * inst/: shapes/fylk-val.shp, shapes/fylk-val.shx, grids/simple.ag,
+ shapes/sids.shp, shapes/sids.shx, grids/test.ag: Initial import.
+
+2005-09-01 20:26 rsbivand
+
+ * inst/: shapes/fylk-val.shp, shapes/fylk-val.shx, grids/simple.ag,
+ shapes/sids.shp, shapes/sids.shx, grids/test.ag: Initial revision
+
+2005-09-01 20:21 rsbivand
+
+ * R/SpatialPolys-methods.R, man/Map2poly.Rd, man/dotsInPolys.Rd,
+ man/get.Pcent.Rd, man/holepolys.Rd, man/maptools.Rd,
+ man/plot.Map.Rd, man/plot.polylist.Rd, man/read.shape.Rd,
+ man/read_ShapeLines.Rd, man/subset.polylist.Rd,
+ man/symbolsInPolys.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/asciigrid.Rd,
+ man/read_ShapePoints.Rd, man/read_ShapePoly.Rd,
+ man/write.polylistShape.Rd, src/Rcentroid.c, src/Rshapeget.c,
+ src/Rshapeinfo.c, src/Rshapewrite.c, src/insiders.c,
+ src/maptools.h, src/Rshapewrite1.c, src/shapefil.h,
+ src/shpopen.c, src/shptree.c, data/gpcholes.rda, inst/LICENSE,
+ inst/changes, inst/shapes/sids.dbf, src/pip.c,
+ inst/shapes/baltim.dbf, inst/shapes/baltim.shp,
+ inst/shapes/baltim.shx, inst/shapes/columbus.dbf,
+ inst/shapes/fylk-val.dbf, inst/shapes/columbus.shp,
+ inst/shapes/columbus.shx: Initial import.
+
+2005-09-01 20:21 rsbivand
+
+ * R/SpatialPolys-methods.R, man/Map2poly.Rd, man/dotsInPolys.Rd,
+ man/get.Pcent.Rd, man/holepolys.Rd, man/maptools.Rd,
+ man/plot.Map.Rd, man/plot.polylist.Rd, man/read.shape.Rd,
+ man/read_ShapeLines.Rd, man/subset.polylist.Rd,
+ man/symbolsInPolys.Rd, man/write.linelistShape.Rd,
+ man/write.pointShape.Rd, man/asciigrid.Rd,
+ man/read_ShapePoints.Rd, man/read_ShapePoly.Rd,
+ man/write.polylistShape.Rd, src/Rcentroid.c, src/Rshapeget.c,
+ src/Rshapeinfo.c, src/Rshapewrite.c, src/insiders.c,
+ src/maptools.h, src/Rshapewrite1.c, src/shapefil.h,
+ src/shpopen.c, src/shptree.c, data/gpcholes.rda, inst/LICENSE,
+ inst/changes, inst/shapes/sids.dbf, src/pip.c,
+ inst/shapes/baltim.dbf, inst/shapes/baltim.shp,
+ inst/shapes/baltim.shx, inst/shapes/columbus.dbf,
+ inst/shapes/fylk-val.dbf, inst/shapes/columbus.shp,
+ inst/shapes/columbus.shx: Initial revision
+
+2005-09-01 20:18 rsbivand
+
+ * DESCRIPTION, INDEX, LICENSE, NAMESPACE, R/shapelib.R,
+ R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/asciigrid.R, R/colslegs.R, R/dotsinpolys.R, R/maptools.R,
+ R/maptoolsChanges.R, R/pcent.R, R/plot.Map.R,
+ R/point.in.polygon.R, R/subset.R, R/zzz.R: Initial import.
+
+2005-09-01 20:18 rsbivand
+
+ * DESCRIPTION, INDEX, LICENSE, NAMESPACE, R/shapelib.R,
+ R/SpatialLines-methods.R, R/SpatialPoints-methods.R,
+ R/asciigrid.R, R/colslegs.R, R/dotsinpolys.R, R/maptools.R,
+ R/maptoolsChanges.R, R/pcent.R, R/plot.Map.R,
+ R/point.in.polygon.R, R/subset.R, R/zzz.R: Initial revision
+
diff --git a/inst/LICENSE b/inst/LICENSE
new file mode 100644
index 0000000..8b59b4a
--- /dev/null
+++ b/inst/LICENSE
@@ -0,0 +1,103 @@
+This file is intended to clarify ownership and copyright: where
+possible individual files also carry brief copyright notices.
+
+Copyrights
+==========
+
+Files: src/shapefil.h, src/shpopen.c and src/shptree.c are
+copyright (c) 1998 Frank Warmerdam, and released under the conditions
+given in http://shapelib.maptools.org/license.html. His code is available
+under the MIT or LGPL licence, and the latter is chosen here.
+
+This software is available under the following "MIT Style" license, or
+at the option of the licensee under the LGPL (see LICENSE.LGPL). This
+option is discussed in more detail in shapelib.html.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Further details of Shapelib may be found at its website
+
+http://shapelib.maptools.org/
+
+It is the intention of the package maintainer to migrate to linking
+against an external shapelib, rather than incoroprating complete files
+unchanged in this package.
+
+Files: src/Rcentroid.c, src/Rshapeinfo.c, src/maptools.h, and
+src/Rshapeget.c are copyright (c) 2000-2001 by Nicholas Lewin-Koh and are
+subject to the licence at the foot of this file. Some portions of these
+files are based on shapelib/contrib files, and copyright and license
+conditions follow from the included code: RingCentroid_2d, shpcat.c,
+shpinfo.c, and SHPRingDir_2d Copyright (c) 1999, Carl Anderson
+
+Files: inst/shapes/baltim.*, inst/shapes/columbus.*, and inst/shapes/sids.*
+are derived by permission from SAL data files
+prepared by Luc Anselin; they were downloaded from:
+
+http://sal.agecon.uiuc.edu/stuff/data.html
+
+under the following conditions: "The data are provided as is, without
+any warranties. Please make sure to give proper credit when using
+them in any publications. Some of the data sets are purely illustrative
+and should not be used for substantive research."
+
+Files: inst/shapes/fylk-val* are copyright Statens Kartverk 2001, and
+were released (with a collection of other shapefiles) to the public domain
+in July 2001. The link to the relevant page under http://www.statkart.no
+has now expired, this copy downloaded 13 July 2001.
+
+Files: inst/shapes/pointZ.* are a sample of points from a 3D point shapefile
+kindly contributed by Michael Toews to be used here for illustrative purposes;
+this sample is written out using writePointsShape().
+
+File: data/wrld_simpl.rda is a modified SpatialPolygonsDataFrame object
+generated from the TM_WORLD_BORDERS_SIMPL-0.2 shapefile downloaded from
+http://mappinghacks.com/data/TM_WORLD_BORDERS_SIMPL-0.2.zip with the
+attribution: "The world_borders.zip dataset has been superseded by Bjørn
+Sandvik's improved version, TM_WORLD_BORDERS-0.2.zip, mirrored from
+thematicmapping.org." The country Polygons objects and the data slot data
+frame row numbers have been set to the ISO 3166 three letter codes.
+
+All other files are copyright (c) 2001-2004 Roger S. Bivand and Nicholas
+Lewin-Koh, and are subject to the licence at the foot of this file.
+
+Licence
+=======
+
+ This is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+
+The file COPYING in the R top-level directory is a copy of the "GNU
+General Public License".
+
+Roger.Bivand at nhh.no
+
+
diff --git a/inst/changes b/inst/changes
new file mode 100644
index 0000000..5401b65
--- /dev/null
+++ b/inst/changes
@@ -0,0 +1,37 @@
+0.7-14 (see ChangeLog for more details) Depecating direct access to Map objectswhich will be removed from the namespace very soon. Started on merging readShape* and write*Shape functions
+0.7-1 GSHHS binary file reading support changed from release 1.3 to 1.5 and shipped coarse shorelines changed to 1.5, released 3 April 2007
+0.6-19 changed sp access to *apply and slot
+0.6-18 Change shapelib license from MIT to LGPL
+0.6-17 Added gcDestination based on contributions from Eric Archer and a list thread for finding a longlat destination given a longlat starting point and bearing, and elide methods to re-scale, reflect, translate and shift coordinates, permitting their relative positions to be retained but their actual locations to be (moderately) masked; a new version of pointLabel from Tom Short is also included
+0.6-16 pass through max_nchar to write.dbf() - thanks to Don MacQueen, updated sp2Mondrian to new format polygon files (with argument to use old format)
+0.6-15 map2* error when the final two coordintes in the input object are NAs - gambia.borders
+0.6-14 added .spatstat_check hack to "SpatialPolygons" to "owin" coercion, and corrected erroneous code for writing line shapefiles (multiple line segments not handled at all until now); write.polylistShape(..., force=TRUE) now default to set nDims attribute on polylist for passing to 3D polygon shapefile.
+0.6-13 Added pointLabel function contributed by Tom Short
+0.6-9 Added skeleton readGPS function using external gpsbabel through system, thanks to Patrick Giraudoux.
+0.6-7 Added GE_SpatialGrid and kmlOverlay preparation of PNG image overlays for Google Earth made by plotting out using the PNG graphics device, suggested by Duncan Golicher and David Forrest.
+0.6-6 Added im object exchange with spatstat, changed sun ephemerides documentation to single page ?"sun-methods".
+0.6-1 Added sun ephemerides by Sebastian P. Luque. In addition, code from off-CRAN packages on the r-spatial sourceforge repository has been added to maptools. This code includes reading GSHHS shoreline data, importing maps package line and polygon objects to Spatial* formats, importing ArcInfo vector data through the RArcInfo package into Spatial* formats, exporting Spatial* objects tp PBSmapping format, exchanging window and point objects with the spatstat package, and using the gpclib [...]
+0.5-16 Fixed bug in dotsInPolys() for returned NULL point objects.
+0.5-13 Passing through 3rd dimension in reading POINTZ shapefiles (bug report thanks to Michael Toews), POINTZ are also now written for 3D point coordinates.
+0.5-12 Added repair= argument to read.shape(), readShape*() functions, and bug fixes to prevent problems caused by shapefiles with malformed *.shx files; the repair= argument is FALSE by default, equivalent to function behaviour until now, but when TRUE, it tries to repair malformed *.shx files typically found in data provided by Geolytics Inc. Bug report thanks to Jon Wakefield.
+0.5-11 sp2WB now no longer emits 1e5 style coordinates, which WinBUGS cannot read; readAsciiGrid and writeAsciiGrid now have dec= arguments to cater for unusual locale handling in ArcGIS 9 (ArcGIS 8 and ArcView 3.2 read "." even in "," decimal mark locales, ArcGIS 9 is not as predictable); trackAzimuth is a wrapper for gzAzimuth to give directions along a track.
+0.5-9 Added azimuth-finding function, a function to output polygon maps for Mondrian, and made plot.Map deprecated; a fuzz factor has been added to writeAsciiGrid() to force cell resolution to equality if the difference is less than the square root of machine precision.
+0.5-6 Added guard functionality and traps for malformed polylist objects and force= argument to write.polylistShape(), thanks to excellent bug report from Marian Eriksson.
+0.5-5 Added function sp2tmap to create a data frame for export to Stata's tmap function from SpatialPolygons objects
+0.5-4 Added function sp2WB() to write SpatialPolygons objects to file for reading in SPlus format by WinBUGS, added argument to readShapePoly() to insert polygon IDs from DBF file column.
+0.5-2 The suggested dependency on splancs has been removed, and the dotsInPolys() and symbolsInPolys() function have been re-written to use sample.Polygons() from sp. Because sp respects holes, users may find that if polygon rings are taken (wrongly) to be holes, they will not receive any dots/symbols. The examples on the help pages show how to use wrapper package spgpc from the r-spatial repository to remedy this. Also the lwd= argument is now passed through in plot.Map().
+0.5-1 Moved functions from off-CRAN spmaptools to maptools, and introduced dependency on the sp package. The functions reading shapefiles directly into sp class objects will become the principal way of getting vector spatial data into R. Helper functions letting this happen step-by-step are not currently exposed in the maptools namespace, but may be if needed. Simple functions to read and write Arc ASCII grid files have also been added.
+0.4-15 Now using C code for ring direction, area and centroids; following a suggestion by Rick Reeves, read.shapes() now reads type 15 (POLYGONZ) shapefiles - confirmed, and should read types 11 POINTZ and 13 ARCZ. For types 13 and 15, it silently drops the third dimension, for type 11, the returned point has three dimensions.
+0.4-14 relieved 8 character file basename limit on writing shapefiles
+0.4-13 subset.polylist() now accepts both old and new polylists (without and with an area attribute)
+0.4-12 Changed condition in tests from 0-4.9 from any() to all(); the plotting order heuristic in Map2poly is replaced with plotting only in strict decreasing order of top-level (multi)polygon area (thanks to Paul Bivand for reporting a malformed plot order from the previous heuristic, involving one polygon disappearing). In multipolygons, the components are plotted in decreasing area order. The multpolygons themselves are assigned their area sum for plotting order. Ring directions are a [...]
+0.4-11 Adding checks for length() being zero
+0.4-10 Function write.linelistShape() added to output a list of lines to a shapefile, as suggested by Patrick Giraudoux.
+0.4-9 A bug in write.polylistShape() found by Greg Snow, provoked by not checking that numeric attributes were integer, has been resolved - they are now set to the required types.
+0.4-8 Functions dbf.read() and dbf.write() replaced by read.dbf() and write.dbf() in the foreign >= 0.8 package; references now made to those functions and package dependency on foreign (which is a recommended package and so not a problem in the course of time). This version of foreign is new, and so will take time to diffuse.
+0.4-7 The dbf.read() and dbf.write() functions have been revised and added to the user-visible namespace. New functions write.pointShape() and write.polylistShape() using dbf.write() has been added to let data.frames be written as point-type shapefiles, or as polygon-type shapefiles with an S3 polylist object, respectively - all these functions should be treated as alpha-quality until they have been in use for some time; reports on software that reads ESRI-generated shapefiles but does n [...]
+0.4-6 Allow axis labels to be passed through plot.polylist() (thanks to Lukas Meier)
+0.4-5 Corrected C code underlying the reading of DBF files to allow character fields to be arbitrarily wide (bug report Trondheim diamonds with fields over 200 characters wide - buffer overflow from unchecked max width 49); Added access to CHANGELOG through maptools() function.
+0.4-4 Corrected C code for reading SHP/SHX files to reduce danger of mismatched PROTECT/UNPROTECT pairs, and hopefully resolve issues with crashes on Windows platforms in some cases.
+0.4-3 Back out of a too-aggressive heuristic for guessing ring-directions and plot-ordering
+0.4-2 Introduced changes including warnings in Map2poly() and plot.polylist() with regard to rind-direction and plot-order heuristics - Map2poly() tries to determine which polygons and sub-polygons are wholly contained within each other, to note the order in which they should be plotted in plot.polygon() to avoid over-plotting when painting polygons, and, if the raw= argument is FALSE, to correct possible wrong ring directions (lakes are not usually found in the sea etc.). plot.polylist( [...]
diff --git a/inst/grids/simple.ag b/inst/grids/simple.ag
new file mode 100644
index 0000000..2dea6b1
--- /dev/null
+++ b/inst/grids/simple.ag
@@ -0,0 +1,10 @@
+NCOLS 3
+NROWS 4
+XLLCORNER 0
+YLLCORNER 0
+CELLSIZE 1
+NODATA_VALUE -9999
+-9999 0.1 2
+ 3 4 5
+ 6 7 8
+ 9 10 -9999
diff --git a/inst/grids/test.ag b/inst/grids/test.ag
new file mode 100644
index 0000000..828b781
--- /dev/null
+++ b/inst/grids/test.ag
@@ -0,0 +1,121 @@
+NCOLS 80
+NROWS 115
+XLLCORNER 178400.000000
+YLLCORNER 329400.000000
+CELLSIZE 40.000000
+NODATA_VALUE 1.0e31
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 633.68 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 712.545 654 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 857.256 755.506 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1003.87 945.002 769.047 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1069.26 983.799 878.379 708. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 922.507 1083.8 945.866 762.595 649 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 717.213 777.331 822.986 764.945 669.406 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 660.1 650.091 638.308 611.437 571.263 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 707.795 638.026 569.719 521.819 508.89 487.974 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 887.388 825.729 652.683 517.784 426.014 445.632 43 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1057.1 960.383 663.773 513.045 432.197 434.055 419. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 843.475 884.551 791.652 601.797 510.573 456.54 420.62 397 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 980.331 870.736 668.36 531.929 500.892 432.629 374.083 3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 749.536 895.292 791.145 607.186 511.044 468.404 399.325 350.36 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 631.296 640.188 590.924 530.624 470.292 395.259 349.999 357.78 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 581.315 525.057 452.094 466.222 440.058 378.669 345.348 353.94 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 593.992 593.677 502.993 428.128 444.087 424.202 384.19 355.385 342.8 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 577.863 572.453 555.076 505.375 463.378 439.787 406.633 357.111 299.379 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 616.093 576.684 534.222 494.367 457.892 425.191 389.124 337.657 265.805 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 648.075 702.031 600.774 527.168 479.024 437.924 402.01 372.16 342.768 314.209 3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 610.327 624.361 565.76 509.988 459.092 407.8 361.026 338.658 333.212 323.209 3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 620.855 564.765 495.324 513.083 488.154 437.746 371.527 287.984 270.453 307.7 312.03 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 716.603 608.398 499.394 501.058 472.886 422.197 354.654 264.571 247.842 290.878 294. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 683.474 614.513 536.742 498.718 461.148 412.154 355.131 306.283 286.513 273.204 262.8 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 683.136 633.049 575.288 516.064 482.195 450.062 403.227 341.609 279.107 270.211 241.246 2 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 797.428 651.882 573.972 447.5 451.586 439.871 398.714 335.133 260.255 257.56 249.629 246.57 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 995.286 896.848 662.984 609.289 422.834 430.906 431.593 399.801 349.908 298.068 244.094 195.847 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 807.947 748.64 628.414 513.138 347.991 411.145 426.218 400.801 361.756 317.105 258.872 221.959 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 796.278 745.489 684.348 604.969 518.226 446.448 435.994 424.695 396.703 364.131 332.56 302.733 285.965 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 880.583 859.451 769.862 689.06 606.39 538.427 486.677 450.602 416.849 380.612 348.808 328.824 317.43 309.509 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 886.723 838.169 814.994 824.124 701.26 604.516 542.752 492.369 444.777 395.817 346.107 301.868 292.4 305.844 310 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1291.12 1056.76 831.44 767.393 742.813 654.552 582.493 539.078 488.366 430.125 364.847 302.808 229.877 232.211 284.364 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1072.54 1366.02 1082.54 804.534 701.531 649.407 595.002 566.41 545.599 482.67 416.283 336.976 258.907 254.098 250.956 269.065 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 816.139 883.365 942.816 843.089 699.424 616.902 580.08 557.019 552.757 525.807 460.971 406.23 345.293 286.796 283.064 269.464 222. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 798.899 778.278 766.498 745.322 674.646 559.588 487.638 501.566 510.724 499.695 460.979 406.54 385.76 364.132 332.58 308.072 272.818 218 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1086.24 894.307 815.647 804.747 768.245 730.629 693.036 599.298 431.758 315.971 424.929 464.482 454.829 406.639 331.609 351.532 368.582 351.358 322.086 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1251.56 1285.23 1542.09 1243.73 939.872 826.437 830.134 772.825 738.259 707.726 579.088 445.45 371.412 410.568 428.25 424.737 397.06 354.351 361.477 373.562 361.499 333.8 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1142.02 1147.25 1497.98 1805.78 1353.4 1259.17 1331.54 1177.08 943.724 818.331 783.818 736.169 693.376 640.514 534.322 450.935 406.548 379.104 373.225 391.158 396.82 388.589 385.127 382.657 3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 865.193 921.085 1127.79 1509.65 1226.56 1062.05 1260.29 1430.92 1225.73 1262.35 1550.48 1191.91 910.436 783.249 727.781 689.104 635.255 551.337 427.5 352.488 348.101 269.705 258.666 343.865 384.657 394.915 394.745 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 885.015 906.723 880.49 969.852 1068.48 917.964 866.45 931.548 1007.28 1004.1 1071.77 1208.53 998.468 814.239 727.057 703.905 709.146 616.413 493.245 303.572 192.341 302.475 225.517 215.297 323.95 375.901 393.684 397.507 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 848.335 877.994 891.809 817.151 799.077 757.336 709.088 651.957 723.552 801.264 805.75 742.749 616.788 648.457 677.093 661.405 679.682 712.322 591.458 471.965 351.324 288.895 324.635 312.396 310.026 348.305 378.634 393.309 3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 947.418 952.075 840.244 778.07 713.781 672.439 678.088 662.448 569.911 643.162 695.097 674.043 542.162 274.951 434.055 570.544 587.046 587.259 574.991 514.224 435.896 380.179 357.881 355.927 354.822 357.655 370.321 384.316 393.714 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1081.63 1127.95 823.722 689.376 602.905 506.154 543.789 608.936 617.042 629.172 634.385 606.762 530.823 440.633 471.277 516.374 519.762 503.937 487.223 447.117 359.853 312.632 341.096 353.725 360.873 368.252 377.058 385.874 392.73 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 791.156 874.423 839.464 666.13 596.16 536.298 456.878 485.538 550.788 580.339 590.029 584.984 562.614 524.882 488.198 470.919 466.861 467.885 464.554 461.032 416.807 320.376 271.35 307.554 324.495 344.635 360.903 373.036 382.397 389.405 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 776.154 669.976 454.686 399.907 494.093 480.965 438.049 442.083 490.004 528.437 543.201 539.092 520.042 489.132 449.283 403.951 384.211 412.47 438.61 437.37 399.132 341.851 285.71 227.438 265.372 316.47 345.605 363.328 375.389 383.983 390 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 879.384 641.947 367.839 328.808 440.665 402.345 246.796 267.629 413.585 479.898 500.579 497.603 479.069 446.738 395.9 308.277 246.108 344.188 390.709 395.239 376.321 334.552 253.91 147.492 225.592 294.838 330.004 351.737 366.635 377.252 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 766.18 768.547 625.419 491.193 444.83 442.375 377.71 222.635 242.195 384.377 448.465 466.306 461.526 442.667 410.685 361.804 294.345 255.837 325.645 363.355 367.953 357.923 326.774 276.157 234.69 248.458 284.058 316.086 340.105 357.45 370.024 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 664.465 644.044 580.753 514.569 473.969 448.292 409.19 358.41 359.799 404.755 433.53 439.006 429.187 410.107 381.753 336.028 268.507 262.5 324.227 359.62 362.204 345 315.326 268.635 210.63 210.295 260.794 301.292 329.116 348.739 362.984 373.514 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 662.101 613.25 541.915 480.134 446.653 435.652 425.132 412.168 410.111 418.2 421.772 413.524 395.338 375.104 356.357 323.636 256.215 250.009 316.507 342.632 343.248 325.386 297.782 246.244 144.555 151.845 239.877 289.816 320.273 341.309 356. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 750.004 630.24 499.561 393.664 361.597 395.348 416.557 420.696 419.64 416.577 407.341 386.406 351.816 320.139 320.743 323.707 308.4 305.984 318.254 319.435 310.318 292.832 275.46 247.104 204.779 205.168 247.896 286.265 314.659 335.645 351.445 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 650.344 687.302 587.463 448.019 272.191 237.273 350.171 400.938 414.613 414.819 408.011 392.7 362.046 302.585 227.826 262.369 313.616 323.675 321.3 311.981 294.62 277.468 234.508 237.477 232.428 205.305 216.738 251.723 284.88 311.32 331.662 347.375 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 582.308 578.796 527.842 437.067 315.813 286.129 356.107 394.88 406.584 406.053 398.114 381.891 351.701 295.392 225.71 258.595 310.336 324.666 322.702 307.217 283.611 263.987 156.609 202.004 208.493 138.41 180.947 245.003 283.426 309.56 329.125 344.3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 585.741 599.328 514.642 446.261 394.374 373.21 383.368 394.9 398.668 396.186 388.498 374.867 353.249 322.978 297.565 301.797 315.971 323.605 326.92 317.894 297.138 270.027 225.769 229.442 222.465 184.068 206.304 252.936 286.127 309.719 327.842 342 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 581.079 614.351 462.83 424.462 408.083 395.808 390.982 389.695 388.178 384.726 378.308 368.163 354.045 337.503 323.388 314.9 308.877 314.556 343.555 344.035 315.4 291.188 270.876 260.28 250.556 240.664 248.039 269.298 291.635 311.038 327.333 340.9 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 506.282 478.119 353.255 293.217 377.247 393.734 388.061 379.77 374.552 372.339 370.323 366.217 359.24 349.556 337.866 324.632 307.22 278.294 264.379 348.519 356.456 322.45 301.79 285.815 271.939 259.951 254.61 260.981 276.265 294.405 311.694 326.903 339.92 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 532.605 459.4 342.172 306.695 363.883 376.912 366.958 352.1 345.879 348.786 352.046 351.499 347.335 340.52 331.383 318.95 299.246 262.026 230.869 294.012 320.274 312.777 300.513 285.317 263.934 237.393 226.075 243.475 269.414 292.168 310.822 326.218 33 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 570.719 633.301 481.689 397.441 369.053 366.784 360.571 334.855 298.228 293.756 316.029 330.556 334.234 332.16 327.569 321.075 311.447 296.952 278.519 270.279 283.797 296.415 298.861 293.15 277.573 243.128 180.702 151.612 204.481 255.57 287.771 309.444 325.623 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 521.268 480.586 373.766 373.265 354.195 347.772 344.408 299.34 208.943 215.844 282.654 309.73 314.765 312.492 309.595 306.692 300.772 289.376 273.141 258.457 258.638 272.966 283.977 284.621 271.69 234.896 162.295 128.434 192.652 251.606 286.919 309.538 325.812 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 601.559 495.012 299.088 223.93 342.281 328.287 327.725 337.466 295.117 211.239 216.526 273.918 293.518 291.723 284.007 282.55 286.749 286.617 275.618 247.307 198.884 193.865 240.465 268.687 277.303 271.431 249.335 213.069 197.914 227.032 264.252 292.153 312.107 32 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 699.524 768.446 571.541 391.136 332.556 351.179 349.984 346.125 340.536 313.28 278.967 270.159 278.541 277.856 261.543 235.883 237.114 260.336 271.458 263.977 231.071 161.407 154.181 222.417 258.672 271.711 272.642 265.118 253.806 250.484 262.367 281.761 300.535 316.365 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 654.275 689.757 724.314 577.368 427.927 334.055 332.95 358.18 357.931 343.069 317.218 290.147 273.807 266.913 257.681 230.786 167.318 175.7 235.458 258.81 257.763 239.553 209.409 205.905 234.162 255.668 266.26 270.532 271.445 271.57 274.553 282.809 294.991 308.258 320.831 1.0e31 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 691.684 715.497 668.058 618.769 535.517 414.857 263.715 292.903 361.213 363.303 339.669 302.339 257.404 233.312 235.407 228.539 220.606 180.548 186.637 232.664 250.201 250.111 244.014 236.659 235.465 242.377 250.499 256.447 261.443 267.341 274.355 282.413 291.858 302.542 313.69 1.0 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 673.884 727.216 780.813 686.208 602.936 535.845 459.044 379.983 373.969 389.961 370.973 331.874 279.484 196.846 150.43 200.339 173.46 206.936 224.573 230.543 240.633 238.675 230.221 230.026 232.217 231.081 231.82 234.944 236.509 240.47 251.77 266.761 281.141 294.032 305.858 316.914 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 666.589 696.381 714.845 709.193 660.112 603.234 563.056 535.807 512.162 482.563 438.544 379.638 315.42 262.758 205.867 171.159 204.213 179.647 212.585 240.598 246.114 239.752 215.406 183.389 197.242 212.793 203.437 201.072 208.609 201.237 199.03 222.738 252.006 275.226 292.796 306.832 1.0e31 1. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 682.694 728.915 759.29 692.081 640.162 606.615 601.211 640.781 697.049 637.7 505.193 385.223 268.435 199.718 228.178 236.439 239.948 237.077 245.178 253.061 249.295 234.401 199.693 146.296 176.065 196.13 155.999 152.225 183.53 153.693 136.08 188.633 237.6 269.531 291.187 307.246 1.0e31 1.0e31 1.0 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 692.324 689.657 706.879 716.014 669.684 627.024 608.736 633.422 757.74 991.279 857.256 575.167 398.318 244.738 149.828 226.533 263.478 269.331 268.466 266.59 259.786 242.967 222.443 208.206 192.905 200.737 199.155 155.657 151.769 181.764 149.243 130.502 185.148 235.555 268.784 291.577 1.0e31 1.0e31 1. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 740.076 707.826 683.79 665.193 637.578 610.763 600.917 629.939 744.693 930.851 821.613 577.015 419.619 311.453 257.384 269.538 284.255 287.25 284.774 277.63 260.536 222.913 173.838 186.735 214.725 223.669 219.334 202.595 197.561 201.945 191.882 188.86 214.378 246.885 273.867 294.758 1.0e31 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 838.342 749.5 688.021 648.796 617.919 593.68 582.211 593.73 637.214 679.938 630.897 519.146 421.325 351.764 312.076 298.281 295.891 295.217 292.548 284.599 264.488 215.865 140.384 168.173 221.999 238.994 238.532 230.349 222.159 216.602 215.33 222.198 238.823 260.549 281.716 1.0e31 1.0e31 1.0e31 1.0e31 1. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1064.08 998.067 779.357 694.73 643.5 604.651 575.959 558.167 552.654 556.456 553.424 521.74 464.991 403.538 349.349 308.693 288.88 287.622 291.233 293.248 289.632 276.681 248.166 213.513 219.006 243.178 253.783 252.078 241.243 221.536 199.639 201.353 224.366 248.608 270.38 289.681 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 946.029 911.572 987.39 898.942 726.565 688.643 635.348 589.413 555.231 531.869 516.964 505.966 491.331 465.679 427.581 379.839 322.755 258.624 230.684 257.271 273.106 286.333 288.778 284.965 278.223 267.118 263.712 267.042 267.826 261.867 244.791 205.889 149.188 157.294 211.969 251.619 277.928 1.0e31 1.0e31 1.0e31 1.0e [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 829.295 1013.56 1274.4 950.23 806.904 748.166 703.655 672.814 616.296 565.226 526.962 501.453 483.996 469.185 452.9 431.804 402.828 361.822 298.428 192.606 130.336 229.726 235.795 276.545 272.814 270.406 290.989 292.4 287.362 282.592 277.374 269.327 252.082 212.615 157.034 164.339 218.739 260.341 287.479 1.0e31 1.0e31 1.0e31 1.0e [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 742.566 810.279 946.957 1103.47 742.529 732.676 706.311 675.972 639.908 582.741 524.672 482.878 461.718 448.974 435.506 420.903 405.676 386.101 355.763 306.118 231.74 198.59 246.664 244.183 297.642 271.525 264.787 305.188 306.592 297.389 286.77 276.98 270.897 263.336 244.358 220.68 222.831 250.283 278.914 301.172 1.0e31 1.0e31 1.0e31 1.0 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 697.398 743.922 783.818 798.579 746.17 590.516 783.929 695.059 669.826 609.653 535.734 454.208 402.867 405.473 409.81 398.242 383.709 377.263 371.576 356.707 330.459 300.157 289.499 305.369 337.232 400.551 411.337 366.017 336.826 311.18 294.852 276.668 255.372 254.939 267.203 270.407 267.372 270.893 284.51 301.837 317.919 1.0e31 1.0e31 1.0e3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 699.58 777.09 863.647 801.178 706.596 669.786 674.4 646.331 612.522 557.709 478.014 342.957 251.534 337.655 372.751 351.984 324.174 335.808 354.274 356.761 348.268 338.64 339.656 362.176 427.499 588.231 695.275 488.434 343.823 279.67 276.696 258.463 208.598 219.19 263.031 286.327 296.062 303.375 313.029 324.504 1.0e31 1.0e31 1.0e31 1.0e31 1.0e3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 635.368 686.305 801.308 1080.06 847.993 662.454 643.815 619.153 592.132 559.238 490.921 432.733 317.537 225.725 322.006 352.571 304.728 237.889 287.991 338.304 354.747 356.837 356.929 364.417 390.584 458.558 608.859 697.425 495.582 302.522 206.109 253.427 260.912 216.496 226.573 273.046 302.919 318.691 328.751 337.497 346.132 1.0e31 1.0e31 1.0e [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 589.608 606.575 639.708 712.045 780.119 554.342 608.678 658.936 597.461 577.205 501.586 344.829 379.31 375.231 347.984 357.075 353.525 309.71 259.007 294.858 336.493 353.556 359.16 362.659 370.828 390.868 431.558 490.279 505.853 426.817 316.419 251.544 273.559 287.069 275.489 280.243 304.68 327.305 342.659 353.067 361 367.708 1.0e31 1.0e31 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 564.305 571.688 575.383 581.747 617.885 634.789 603.075 610.869 619.228 574.466 538.65 427.112 221.291 346.665 391.424 385.734 374.592 359.314 337.555 321.459 328.303 343.319 352.706 357 359.85 364.866 375.624 394.299 415.008 418.145 391.062 348.555 319.3 317.176 322.024 323.394 329.588 343.354 358.492 370.736 379.596 385.919 390.538 393.988 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 554.364 558.582 561.252 560.816 572.914 579.41 574.071 566.225 553.409 561.478 595.344 483.113 397.291 393.957 400.465 390.218 370.468 348.346 334.541 332.819 337.89 344.383 348.703 350.41 350.488 350.034 351.048 357.186 368.82 377.494 375.186 364.579 355.52 354.401 358.678 364.814 373.21 384.007 394.997 403.988 410.231 413.981 415.821 416.332 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 547.671 551.919 549.569 548.62 547.927 542.401 539.203 536.005 530.387 532.243 541.054 601.09 448.504 422.541 412.615 402.04 382.405 348.137 302.683 287.488 310.445 328.959 337.22 339.671 339.023 335.659 327.372 313.602 306.694 322.36 347.472 364.924 373.667 379.356 386.57 396.29 407.446 418.923 429.616 438.25 443.958 446.624 446.641 444.622 441.259 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 538.18 554.042 568.231 550.216 529.658 514.881 500.292 498.53 502.069 495.301 471.638 465.714 315.769 286.354 394.489 405.606 394.817 370.39 320.577 228.079 204.478 278.66 314.904 325.048 324.996 321.999 316.876 300.399 259.55 223.146 259.328 317.896 357.412 382.342 401.369 419.664 438.862 457.9 474.349 485.987 492.017 493.148 490.591 485.264 477.874 469.265 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 524.782 533.122 551.21 570.552 544.276 510.256 481.24 445.408 452.508 474.898 475.535 466.675 476.26 404.974 365.912 390.731 393.847 383.513 361.698 318.623 246.528 227.509 279.306 305.969 309.877 302.082 294.972 295.018 281.654 222.967 157.218 216.561 302.23 357.455 395.16 427.129 459.276 492.944 525.103 549.682 561.773 561.786 554.367 543.633 530.877 516.22 500.531 485 [...]
+ 1.0e31 1.0e31 1.0e31 517.945 522.032 525.025 529.498 530.89 513.526 488.225 462.818 431.947 438.381 457.536 461.082 474.605 526.079 438.919 398.908 384.791 375.132 367.364 354.571 330.528 300.094 286.426 292.466 297.614 291.523 266.683 246.321 266.26 278.273 250.474 217.778 253.302 317.052 370.191 415.079 459.895 510.311 567.245 623.292 662.264 670.934 654.044 628.47 605.09 583.289 559.58 534.572 [...]
+ 1.0e31 1.0e31 1.0e31 520.016 528.188 527.504 515.492 501.098 482.832 463.899 450.484 442.875 442.636 443.799 439.506 431.32 397.622 363.115 373.682 349.233 331.99 340.282 343.072 331.995 312.529 292.338 278.974 278.789 274.948 238.278 199.309 243.424 281.45 287.636 287.421 308.347 347.617 392.476 441.428 499.944 575.301 671.191 774.965 844.363 837.594 773.989 708.739 667.884 639.224 606.126 569. [...]
+ 1.0e31 1.0e31 511.043 523.726 543.206 546.376 514.572 482.109 453.373 429.128 420.825 424.693 428.305 427.935 419.139 402.997 358.281 324.494 347.385 273.272 238.639 303.98 329.162 325.183 303.214 262.51 222.103 239.728 264.091 253.502 236.411 261.393 292.523 310.418 324.003 344.489 375.596 416.644 469.824 542.832 649.201 804.656 1001.65 1145.11 1097.52 919.672 773.874 713.291 689.244 649.865 [...]
+ 1.0e31 1.0e31 506.599 518.992 537.202 538.579 504.313 464.005 422.388 376.868 369.862 393.362 405.011 412.843 410.099 400.965 392.224 373.771 347.994 261.054 226.041 295.077 321.421 318.237 293.446 236.036 164.075 206.441 256.654 270.068 274.376 287.854 307.345 325.785 343.995 366.254 396.217 437.033 494.17 578.875 712.551 929.888 1251.38 1529.66 1423 1062.14 804.247 724.269 716.734 677.469 61 [...]
+ 1.0e31 1.0e31 498.508 505.029 511.043 505.489 481.6 447.793 405.453 351.938 344.768 363.361 373.501 398.562 407.177 409.004 416.526 412.378 373.588 325.818 303.738 313.379 319.747 314.087 294.497 256.709 220.004 232.846 254.861 268.791 283.31 299.665 317.583 336.184 356.097 379.618 409.841 450.818 509.196 597.274 737.915 968.788 1315.09 1621.83 1505.66 1106.78 823.057 728.338 714.327 676.691 [...]
+ 1.0e31 1.0e31 489.39 490.602 489.26 481.107 463.922 439.538 409.971 381.33 369.968 350.573 359.285 390.426 403.985 417.426 462.427 477.238 395.442 346.554 324.732 317.615 314.122 308.773 297.647 278.967 259.446 243.865 229.799 243.231 273.636 300.08 322.009 342.34 363.393 387.507 417.515 457.287 512.83 594.095 716.974 900.73 1138.91 1315.84 1249.77 1015.65 822.674 732.388 694.934 654.657 604.775 [...]
+ 1.0e31 1.0e31 481.466 479.719 475.556 467.324 454.286 437.233 418.176 400.773 387.625 376.895 379.489 390.6 397.822 408.603 436.354 436.269 370.469 322.43 306.432 301.229 296.573 296.324 294.48 284.635 264.518 222.569 167.044 199.27 258.655 297.11 323.603 345.753 367.506 391.532 420.424 457.381 506.823 574.91 668.928 791.915 925.667 1.0e31 1.0e31 1.0e31 1.0e31 711.135 666.371 625.581 582.023 537.879 [...]
+ 1.0e31 1.0e31 475.49 472.446 467.518 460.037 449.8 437.345 423.925 411.241 400.592 392.983 389.598 387.879 385.449 384.56 383.729 363.154 303.718 244.42 260.608 271.783 260.528 273.297 285.532 282.608 265.934 227.714 180.986 207.423 261.141 298.866 325.687 348.068 369.663 392.891 419.888 452.998 494.988 548.855 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 519.526 478.682 437.05 [...]
+ 1.0e31 473.833 471.463 468.056 463.234 456.698 448.401 438.655 428.112 417.562 407.615 398.406 389.124 377.936 364.639 353.261 344.465 321.467 255.633 167.556 225.373 252.179 224.066 254.288 276.795 276.001 266.201 252.458 240.679 251.719 279.158 306.072 329.183 350.086 370.664 392.529 417.187 446.163 480.963 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 429. [...]
+ 1.0e31 471.573 469.19 465.972 461.692 456.173 449.348 441.301 432.237 422.363 411.652 399.46 383.985 362.045 331.55 304.613 305.098 304.169 272.255 236.303 249.463 259.478 252.445 264.701 271.363 258.052 245.895 252.187 263.291 276.358 293.884 313.337 332.676 351.661 370.867 391.132 413.369 438.471 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 468.485 465.856 462.464 458.146 452.74 446.08 437.983 428.201 416.264 401.079 380.092 347.652 293.866 232.78 256.494 294.128 289.27 269.75 254.023 256.662 269.569 275.803 264.385 220.012 185.861 224.284 261.324 282.598 299.765 316.995 334.592 352.354 370.409 389.177 409.193 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 41 [...]
+ 1.0e31 1.0e31 469.193 467.532 465.446 462.764 459.194 454.276 447.379 437.784 424.764 407.336 383.41 348.209 294.033 237.491 258.543 296.143 295.27 265.247 208.841 219.191 268.485 283.376 266.356 207.532 161.681 214.696 257.976 280.011 298.045 316.246 334.344 352.033 369.472 387.048 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 471.155 470.872 470.655 470.384 469.68 467.718 463.146 454.412 440.488 421.193 396.46 365.566 329.57 302.095 302.928 311.309 304.423 275.719 226.432 235.285 282.408 299.838 288.407 254.611 231.259 243.064 253.963 266.517 288.179 311.409 332.384 351.118 368.447 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 474.142 475.66 478.008 481.307 485.318 488.893 489.383 483.079 467.769 444.945 418.093 390.002 363.507 343.529 332.244 323.722 314.814 303.712 290.835 297.303 319.616 330.799 322.324 300.426 277.009 249.89 217.402 229.783 270.513 304.892 330.419 350.603 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 [...]
+ 1.0e31 1.0e31 1.0e31 481.455 487.045 495.296 506.735 520.569 532.276 532.368 513.638 481.389 446.935 416.298 390.24 367.374 344.054 317.608 303.923 315.553 329.176 345.377 367.486 378.64 364.305 336.972 302.386 243.877 173.32 198.623 260.852 303.376 331.268 351.763 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e3 [...]
+ 1.0e31 1.0e31 1.0e31 487.499 496.655 510.839 532.42 563.076 597.852 614.457 587.52 532.431 481.309 443.779 415.247 387.626 350.8 295.559 262.544 308.593 350.769 381.04 418.955 443.37 409.746 370.012 334.935 282.049 227.838 236.938 278.453 312.551 336.913 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e3 [...]
+ 1.0e31 1.0e31 1.0e31 492.769 505.039 524.644 556.382 606.771 675.74 724.395 683.488 589.026 515.062 471.504 444.346 417.761 377.76 320.887 291.045 332.041 375.99 405.956 441.125 467.697 427.942 392.174 373.598 339.438 304.164 296.27 310.32 329.304 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 510.266 532.635 569.166 628.61 714.267 781.245 733.905 619.168 536.765 497.074 482.03 468.179 434.643 391.136 371.713 389.126 416.386 431.483 437.408 437.306 416.669 401.139 399.435 375.403 348.73 336.59 338.233 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e3 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 532.67 565.839 615.736 679.571 721.588 686.055 603.213 541.19 518.26 528.351 542.097 509.362 457.16 435.489 449.99 480.411 486.387 461.37 436.11 415.113 402.591 399.131 385.905 369.681 360.038 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 551.071 583.696 617.703 633.566 612.464 568.902 535.246 530.572 561.667 598.999 562.516 498.169 475.595 501.87 563.093 574.707 508.764 454.405 423.78 407.209 398.501 389.86 380.7 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 567.652 572.35 560.846 540.246 525.235 528.144 553.139 576.34 551.317 507.041 492.692 521.605 584.038 596.165 528.025 468.105 433.818 414.767 403.534 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 535.315 529.265 519.669 513.194 515.394 525.783 531.785 519.048 498.716 492.507 509.295 538.387 541.539 506.405 466.743 438.735 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1. [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 500.987 501.027 503.321 502.935 496.202 487.323 484.31 490.338 499.111 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
+ 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1.0e31 1 [...]
diff --git a/inst/shapes/baltim.dbf b/inst/shapes/baltim.dbf
new file mode 100644
index 0000000..be9d815
Binary files /dev/null and b/inst/shapes/baltim.dbf differ
diff --git a/inst/shapes/baltim.shp b/inst/shapes/baltim.shp
new file mode 100644
index 0000000..f867886
Binary files /dev/null and b/inst/shapes/baltim.shp differ
diff --git a/inst/shapes/baltim.shx b/inst/shapes/baltim.shx
new file mode 100644
index 0000000..8414722
Binary files /dev/null and b/inst/shapes/baltim.shx differ
diff --git a/inst/shapes/columbus.dbf b/inst/shapes/columbus.dbf
new file mode 100644
index 0000000..f850bda
Binary files /dev/null and b/inst/shapes/columbus.dbf differ
diff --git a/inst/shapes/columbus.shp b/inst/shapes/columbus.shp
new file mode 100644
index 0000000..d6dde43
Binary files /dev/null and b/inst/shapes/columbus.shp differ
diff --git a/inst/shapes/columbus.shx b/inst/shapes/columbus.shx
new file mode 100644
index 0000000..7086b6f
Binary files /dev/null and b/inst/shapes/columbus.shx differ
diff --git a/inst/shapes/fylk-val-ll.dbf b/inst/shapes/fylk-val-ll.dbf
new file mode 100644
index 0000000..7636754
Binary files /dev/null and b/inst/shapes/fylk-val-ll.dbf differ
diff --git a/inst/shapes/fylk-val-ll.shp b/inst/shapes/fylk-val-ll.shp
new file mode 100644
index 0000000..9b2d065
Binary files /dev/null and b/inst/shapes/fylk-val-ll.shp differ
diff --git a/inst/shapes/fylk-val-ll.shx b/inst/shapes/fylk-val-ll.shx
new file mode 100644
index 0000000..a4fb37a
Binary files /dev/null and b/inst/shapes/fylk-val-ll.shx differ
diff --git a/inst/shapes/fylk-val.dbf b/inst/shapes/fylk-val.dbf
new file mode 100644
index 0000000..f0eca6d
Binary files /dev/null and b/inst/shapes/fylk-val.dbf differ
diff --git a/inst/shapes/fylk-val.shp b/inst/shapes/fylk-val.shp
new file mode 100644
index 0000000..134a525
Binary files /dev/null and b/inst/shapes/fylk-val.shp differ
diff --git a/inst/shapes/fylk-val.shx b/inst/shapes/fylk-val.shx
new file mode 100644
index 0000000..6a9556e
Binary files /dev/null and b/inst/shapes/fylk-val.shx differ
diff --git a/inst/shapes/pointZ.dbf b/inst/shapes/pointZ.dbf
new file mode 100644
index 0000000..b379b45
Binary files /dev/null and b/inst/shapes/pointZ.dbf differ
diff --git a/inst/shapes/pointZ.prj b/inst/shapes/pointZ.prj
new file mode 100644
index 0000000..00cb470
--- /dev/null
+++ b/inst/shapes/pointZ.prj
@@ -0,0 +1 @@
+PROJCS["NAD_1983_UTM_Zone_10N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
diff --git a/inst/shapes/pointZ.shp b/inst/shapes/pointZ.shp
new file mode 100644
index 0000000..3797f1a
Binary files /dev/null and b/inst/shapes/pointZ.shp differ
diff --git a/inst/shapes/pointZ.shx b/inst/shapes/pointZ.shx
new file mode 100644
index 0000000..5f48b43
Binary files /dev/null and b/inst/shapes/pointZ.shx differ
diff --git a/inst/shapes/sids.dbf b/inst/shapes/sids.dbf
new file mode 100644
index 0000000..9520178
Binary files /dev/null and b/inst/shapes/sids.dbf differ
diff --git a/inst/shapes/sids.shp b/inst/shapes/sids.shp
new file mode 100644
index 0000000..79c4a41
Binary files /dev/null and b/inst/shapes/sids.shp differ
diff --git a/inst/shapes/sids.shx b/inst/shapes/sids.shx
new file mode 100644
index 0000000..670fa43
Binary files /dev/null and b/inst/shapes/sids.shx differ
diff --git a/inst/share/Splus.map b/inst/share/Splus.map
new file mode 100644
index 0000000..74b0841
--- /dev/null
+++ b/inst/share/Splus.map
@@ -0,0 +1,27 @@
+map:3
+xScale: 1000
+yScale: 1000
+1 area1
+2 area2
+3 area3
+area1 0 2
+area1 1 2
+area1 1 3
+area1 0 3
+NA NA NA
+area1 2 1
+area1 4 1
+area1 4 3
+area1 2 3
+NA NA NA
+area2 0 0
+area2 2 0
+area2 2 1
+area2 0 1
+NA NA NA
+area3 2 0
+area3 3 0
+area3 3 1
+area3 2 1
+END
+
diff --git a/inst/share/co37_d90.e00 b/inst/share/co37_d90.e00
new file mode 100644
index 0000000..799ab1c
--- /dev/null
+++ b/inst/share/co37_d90.e00
@@ -0,0 +1,5046 @@
+EXP 0 /SATURN/COB/BDY_EXPORT/WORKING/TEST1/CO37_D90.E00
+ARC 2
+ 1 30142 2 1 2 1 7
+-8.1353500E+01 3.6574600E+01-8.1442398E+01 3.6576698E+01
+-8.1476601E+01 3.6580299E+01-8.1489601E+01 3.6578899E+01
+-8.1521202E+01 3.6580399E+01-8.1601105E+01 3.6586899E+01
+-8.1677696E+01 3.6588001E+01
+ 2 30157 3 2 3 1 4
+-8.0901932E+01 3.6561623E+01-8.1003998E+01 3.6563499E+01
+-8.1176903E+01 3.6571800E+01-8.1353500E+01 3.6574600E+01
+ 3 31782 3 4 1 4 2
+-8.0901932E+01 3.6561623E+01-8.0838158E+01 3.6559013E+01
+ 4 31869 4 5 1 4 3
+-8.0838158E+01 3.6559013E+01-8.0705040E+01 3.6562187E+01
+-8.0612366E+01 3.6557705E+01
+ 5 35521 9 5 4 1 2
+-8.0440323E+01 3.6550495E+01-8.0612366E+01 3.6557705E+01
+ 6 34093 10 8 7 1 2
+-7.6313553E+01 3.6550400E+01-7.6491837E+01 3.6550560E+01
+ 7 29372 7 11 6 1 2
+-7.5867432E+01 3.6550755E+01-7.6122704E+01 3.6550400E+01
+ 8 37244 11 10 6 1 2
+-7.6122704E+01 3.6550400E+01-7.6313553E+01 3.6550400E+01
+ 9 34093 8 12 7 1 2
+-7.6491837E+01 3.6550560E+01-7.6542015E+01 3.6550159E+01
+ 10 34136 12 6 5 1 2
+-7.6542015E+01 3.6550159E+01-7.6916214E+01 3.6551941E+01
+ 11 35756 15 13 1 9 2
+-7.7297188E+01 3.6544662E+01-7.7164818E+01 3.6546181E+01
+ 12 35061 15 14 9 1 2
+-7.7297188E+01 3.6544662E+01-7.7767410E+01 3.6545273E+01
+ 13 31329 16 14 1 9 2
+-7.7900063E+01 3.6544518E+01-7.7767410E+01 3.6545273E+01
+ 14 31329 17 16 1 11 2
+-7.8046486E+01 3.6544010E+01-7.7900063E+01 3.6544518E+01
+ 15 36603 18 17 1 11 2
+-7.8324188E+01 3.6543667E+01-7.8046486E+01 3.6544010E+01
+ 16 34136 6 19 5 1 2
+-7.6916214E+01 3.6551941E+01-7.6916367E+01 3.6543663E+01
+ 17 35756 13 19 1 10 3
+-7.7164818E+01 3.6546181E+01-7.7153000E+01 3.6543926E+01
+-7.6916367E+01 3.6543663E+01
+ 18 35552 21 20 1 8 2
+-8.0053696E+01 3.6542347E+01-8.0027504E+01 3.6542355E+01
+ 19 35521 21 9 8 1 3
+-8.0053696E+01 3.6542347E+01-8.0295464E+01 3.6543835E+01
+-8.0440323E+01 3.6550495E+01
+ 20 36603 22 18 1 12 2
+-7.8457245E+01 3.6542332E+01-7.8324188E+01 3.6543667E+01
+ 21 34505 24 20 13 1 2
+-7.9715096E+01 3.6541801E+01-8.0027504E+01 3.6542355E+01
+ 22 35144 23 26 14 1 2
+-7.8734428E+01 3.6541809E+01-7.8796577E+01 3.6541573E+01
+ 23 35144 26 25 16 1 2
+-7.8796577E+01 3.6541573E+01-7.9138199E+01 3.6541599E+01
+ 24 34471 25 27 15 1 2
+-7.9138199E+01 3.6541599E+01-7.9218895E+01 3.6541500E+01
+ 25 34471 27 28 15 1 2
+-7.9218895E+01 3.6541500E+01-7.9342941E+01 3.6541229E+01
+ 26 36603 23 22 1 14 3
+-7.8734428E+01 3.6541809E+01-7.8511597E+01 3.6540810E+01
+-7.8457245E+01 3.6542332E+01
+ 27 34471 28 29 15 1 2
+-7.9342941E+01 3.6541229E+01-7.9470413E+01 3.6540684E+01
+ 28 34471 29 30 15 1 2
+-7.9470413E+01 3.6540684E+01-7.9510895E+01 3.6540600E+01
+ 29 34505 30 24 13 1 2
+-7.9510895E+01 3.6540600E+01-7.9715096E+01 3.6541801E+01
+ 30 34090 12 31 7 5 2
+-7.6542015E+01 3.6550159E+01-7.6491806E+01 3.6510384E+01
+ 31 42730 16 32 9 11 2
+-7.7900063E+01 3.6544518E+01-7.7898239E+01 3.6506699E+01
+ 32 30149 3 33 4 3 7
+-8.0901932E+01 3.6561623E+01-8.0908752E+01 3.6556515E+01
+-8.0918800E+01 3.6540287E+01-8.0927078E+01 3.6501141E+01
+-8.0976280E+01 3.6445129E+01-8.0953026E+01 3.6418091E+01
+-8.0967583E+01 3.6401577E+01
+ 33 30142 1 34 2 1 37
+-8.1677696E+01 3.6588001E+01-8.1680305E+01 3.6585098E+01
+-8.1677200E+01 3.6581100E+01-8.1679306E+01 3.6578602E+01
+-8.1677200E+01 3.6570599E+01-8.1680603E+01 3.6568401E+01
+-8.1691399E+01 3.6567799E+01-8.1690193E+01 3.6552036E+01
+-8.1693466E+01 3.6550980E+01-8.1699928E+01 3.6536892E+01
+-8.1708237E+01 3.6535652E+01-8.1708267E+01 3.6524208E+01
+-8.1702713E+01 3.6520199E+01-8.1697227E+01 3.6505707E+01
+-8.1700386E+01 3.6498268E+01-8.1696075E+01 3.6491459E+01
+-8.1698219E+01 3.6488121E+01-8.1695480E+01 3.6467793E+01
+-8.1699394E+01 3.6463840E+01-8.1708420E+01 3.6462097E+01
+-8.1709625E+01 3.6459393E+01-8.1717018E+01 3.6456444E+01
+-8.1713890E+01 3.6446949E+01-8.1717911E+01 3.6444878E+01
+-8.1714607E+01 3.6441498E+01-8.1714790E+01 3.6437218E+01
+-8.1721359E+01 3.6433781E+01-8.1717979E+01 3.6429684E+01
+-8.1720901E+01 3.6422417E+01-8.1727150E+01 3.6419716E+01
+-8.1734589E+01 3.6412323E+01-8.1741882E+01 3.6412270E+01
+-8.1741455E+01 3.6402855E+01-8.1738365E+01 3.6400703E+01
+-8.1739548E+01 3.6395473E+01-8.1731949E+01 3.6394753E+01
+-8.1728851E+01 3.6391041E+01
+ 34 34135 35 31 5 18 3
+-7.6454025E+01 3.6377888E+01-7.6491737E+01 3.6468494E+01
+-7.6491806E+01 3.6510384E+01
+ 35 30200 33 36 19 3 25
+-8.0967583E+01 3.6401577E+01-8.0981117E+01 3.6386410E+01
+-8.0978004E+01 3.6380371E+01-8.0981575E+01 3.6374371E+01
+-8.1028061E+01 3.6374355E+01-8.1043976E+01 3.6393703E+01
+-8.1044472E+01 3.6410976E+01-8.1077629E+01 3.6417664E+01
+-8.1078819E+01 3.6426144E+01-8.1083275E+01 3.6429482E+01
+-8.1084030E+01 3.6433399E+01-8.1091507E+01 3.6435493E+01
+-8.1097496E+01 3.6432812E+01-8.1103973E+01 3.6434322E+01
+-8.1112511E+01 3.6429424E+01-8.1120247E+01 3.6429008E+01
+-8.1135048E+01 3.6419353E+01-8.1145622E+01 3.6419167E+01
+-8.1150269E+01 3.6425831E+01-8.1161232E+01 3.6429478E+01
+-8.1165840E+01 3.6437584E+01-8.1189262E+01 3.6399368E+01
+-8.1201424E+01 3.6394493E+01-8.1225861E+01 3.6376389E+01
+-8.1250839E+01 3.6363235E+01
+ 36 30134 2 36 3 2 33
+-8.1353500E+01 3.6574600E+01-8.1355164E+01 3.6547684E+01
+-8.1353081E+01 3.6545811E+01-8.1348991E+01 3.6552147E+01
+-8.1346581E+01 3.6552025E+01-8.1348114E+01 3.6539955E+01
+-8.1329834E+01 3.6518639E+01-8.1327164E+01 3.6504398E+01
+-8.1322296E+01 3.6496025E+01-8.1322350E+01 3.6480537E+01
+-8.1307907E+01 3.6480293E+01-8.1303200E+01 3.6474476E+01
+-8.1299515E+01 3.6474316E+01-8.1296738E+01 3.6464653E+01
+-8.1287415E+01 3.6461468E+01-8.1282478E+01 3.6454319E+01
+-8.1274551E+01 3.6448730E+01-8.1265518E+01 3.6432835E+01
+-8.1262817E+01 3.6418652E+01-8.1268219E+01 3.6412060E+01
+-8.1263069E+01 3.6407772E+01-8.1264565E+01 3.6406708E+01
+-8.1266953E+01 3.6408699E+01-8.1266106E+01 3.6403019E+01
+-8.1263863E+01 3.6403801E+01-8.1259651E+01 3.6398575E+01
+-8.1255478E+01 3.6398781E+01-8.1255203E+01 3.6396282E+01
+-8.1245842E+01 3.6390812E+01-8.1244392E+01 3.6382019E+01
+-8.1246590E+01 3.6374149E+01-8.1252731E+01 3.6368263E+01
+-8.1250839E+01 3.6363235E+01
+ 37 35478 35 37 21 5 4
+-7.6454025E+01 3.6377888E+01-7.6539543E+01 3.6357079E+01
+-7.6557327E+01 3.6354923E+01-7.6559784E+01 3.6351181E+01
+ 38 31064 37 38 22 5 20
+-7.6559784E+01 3.6351181E+01-7.6571045E+01 3.6334133E+01
+-7.6586555E+01 3.6333187E+01-7.6593826E+01 3.6329021E+01
+-7.6596245E+01 3.6323090E+01-7.6609299E+01 3.6322899E+01
+-7.6622963E+01 3.6328503E+01-7.6639290E+01 3.6329082E+01
+-7.6642494E+01 3.6319767E+01-7.6646935E+01 3.6319904E+01
+-7.6650192E+01 3.6317364E+01-7.6650925E+01 3.6310841E+01
+-7.6654854E+01 3.6310543E+01-7.6654602E+01 3.6313931E+01
+-7.6670219E+01 3.6314919E+01-7.6674942E+01 3.6308784E+01
+-7.6672737E+01 3.6306381E+01-7.6675903E+01 3.6306175E+01
+-7.6672768E+01 3.6303120E+01-7.6696930E+01 3.6296055E+01
+ 39 41266 19 38 5 10 40
+-7.6916367E+01 3.6543663E+01-7.6914352E+01 3.6542278E+01
+-7.6916374E+01 3.6538921E+01-7.6921776E+01 3.6538254E+01
+-7.6920227E+01 3.6532673E+01-7.6925247E+01 3.6530613E+01
+-7.6923073E+01 3.6528763E+01-7.6916283E+01 3.6530457E+01
+-7.6905060E+01 3.6522129E+01-7.6903442E+01 3.6519150E+01
+-7.6906853E+01 3.6515160E+01-7.6907013E+01 3.6509796E+01
+-7.6912247E+01 3.6504391E+01-7.6920059E+01 3.6504753E+01
+-7.6925522E+01 3.6488525E+01-7.6935364E+01 3.6483765E+01
+-7.6934616E+01 3.6471214E+01-7.6950882E+01 3.6470703E+01
+-7.6947136E+01 3.6465816E+01-7.6949387E+01 3.6457333E+01
+-7.6945480E+01 3.6440929E+01-7.6947578E+01 3.6416336E+01
+-7.6945183E+01 3.6411373E+01-7.6932137E+01 3.6400917E+01
+-7.6906487E+01 3.6389885E+01-7.6894463E+01 3.6390041E+01
+-7.6882797E+01 3.6382565E+01-7.6873260E+01 3.6382839E+01
+-7.6852165E+01 3.6375263E+01-7.6838089E+01 3.6373859E+01
+-7.6823196E+01 3.6364449E+01-7.6795456E+01 3.6359795E+01
+-7.6783905E+01 3.6362724E+01-7.6777077E+01 3.6361221E+01
+-7.6769501E+01 3.6354698E+01-7.6759712E+01 3.6350719E+01
+-7.6737411E+01 3.6325329E+01-7.6726707E+01 3.6318535E+01
+-7.6715744E+01 3.6307114E+01-7.6696930E+01 3.6296055E+01
+ 40 30705 34 39 20 1 31
+-8.1728851E+01 3.6391041E+01-8.1729607E+01 3.6385151E+01
+-8.1734818E+01 3.6379375E+01-8.1726166E+01 3.6368591E+01
+-8.1727249E+01 3.6365475E+01-8.1722855E+01 3.6360809E+01
+-8.1724487E+01 3.6357635E+01-8.1721626E+01 3.6351044E+01
+-8.1717575E+01 3.6347656E+01-8.1708443E+01 3.6346149E+01
+-8.1705833E+01 3.6342865E+01-8.1707611E+01 3.6335049E+01
+-8.1718735E+01 3.6335995E+01-8.1726898E+01 3.6340813E+01
+-8.1736130E+01 3.6342865E+01-8.1745911E+01 3.6337421E+01
+-8.1754585E+01 3.6336922E+01-8.1761398E+01 3.6340153E+01
+-8.1765099E+01 3.6338547E+01-8.1779083E+01 3.6348515E+01
+-8.1789879E+01 3.6348202E+01-8.1793259E+01 3.6362339E+01
+-8.1796600E+01 3.6359554E+01-8.1810349E+01 3.6351780E+01
+-8.1833092E+01 3.6347309E+01-8.1853203E+01 3.6336437E+01
+-8.1855171E+01 3.6337135E+01-8.1865631E+01 3.6329224E+01
+-8.1879211E+01 3.6313866E+01-8.1908295E+01 3.6301891E+01
+-8.1918335E+01 3.6286903E+01
+ 41 49470 40 18 12 11 3
+-7.8307083E+01 3.6265949E+01-7.8277763E+01 3.6306103E+01
+-7.8324188E+01 3.6543667E+01
+ 42 30660 39 41 24 1 2
+-8.1918335E+01 3.6286903E+01-8.1933159E+01 3.6264759E+01
+ 43 49077 42 9 4 8 3
+-8.0452171E+01 3.6261414E+01-8.0447388E+01 3.6423317E+01
+-8.0440323E+01 3.6550495E+01
+ 44 48407 20 43 13 8 4
+-8.0027504E+01 3.6542355E+01-8.0033699E+01 3.6340435E+01
+-8.0032883E+01 3.6295738E+01-8.0035774E+01 3.6257259E+01
+ 45 39734 43 42 26 8 2
+-8.0035774E+01 3.6257259E+01-8.0452171E+01 3.6261414E+01
+ 46 34504 44 30 13 15 3
+-7.9532219E+01 3.6249851E+01-7.9520218E+01 3.6463043E+01
+-7.9510895E+01 3.6540600E+01
+ 47 41278 13 45 10 9 56
+-7.7164818E+01 3.6546181E+01-7.7160721E+01 3.6541775E+01
+-7.7158203E+01 3.6542831E+01-7.7157516E+01 3.6539783E+01
+-7.7151306E+01 3.6540424E+01-7.7153687E+01 3.6537907E+01
+-7.7148926E+01 3.6534016E+01-7.7152901E+01 3.6529324E+01
+-7.7149330E+01 3.6525021E+01-7.7132065E+01 3.6522404E+01
+-7.7127640E+01 3.6518101E+01-7.7123207E+01 3.6520432E+01
+-7.7121422E+01 3.6519196E+01-7.7121712E+01 3.6522446E+01
+-7.7119553E+01 3.6523041E+01-7.7114616E+01 3.6521626E+01
+-7.7114845E+01 3.6518394E+01-7.7108353E+01 3.6516636E+01
+-7.7102905E+01 3.6517075E+01-7.7103668E+01 3.6520920E+01
+-7.7099083E+01 3.6516983E+01-7.7093185E+01 3.6518200E+01
+-7.7083458E+01 3.6513027E+01-7.7083595E+01 3.6507305E+01
+-7.7081352E+01 3.6507900E+01-7.7085548E+01 3.6505245E+01
+-7.7086090E+01 3.6500000E+01-7.7080139E+01 3.6496296E+01
+-7.7074577E+01 3.6496319E+01-7.7073929E+01 3.6499409E+01
+-7.7066612E+01 3.6496849E+01-7.7070107E+01 3.6494446E+01
+-7.7067299E+01 3.6492409E+01-7.7069412E+01 3.6488930E+01
+-7.7066498E+01 3.6487232E+01-7.7066696E+01 3.6482815E+01
+-7.7070976E+01 3.6483547E+01-7.7071144E+01 3.6479404E+01
+-7.7075233E+01 3.6480984E+01-7.7074432E+01 3.6478123E+01
+-7.7076706E+01 3.6480522E+01-7.7080162E+01 3.6478741E+01
+-7.7083107E+01 3.6476723E+01-7.7083504E+01 3.6472328E+01
+-7.7085457E+01 3.6475422E+01-7.7093735E+01 3.6472488E+01
+-7.7099655E+01 3.6479099E+01-7.7107933E+01 3.6475868E+01
+-7.7112411E+01 3.6477676E+01-7.7115242E+01 3.6473827E+01
+-7.7120491E+01 3.6473576E+01-7.7126579E+01 3.6464100E+01
+-7.7137444E+01 3.6455452E+01-7.7131744E+01 3.6437672E+01
+-7.7190773E+01 3.6286537E+01-7.7209106E+01 3.6246719E+01
+ 48 29315 46 44 28 15 2
+-7.9257225E+01 3.6243732E+01-7.9532219E+01 3.6249851E+01
+ 49 31062 38 47 22 10 3
+-7.6696930E+01 3.6296055E+01-7.6689789E+01 3.6269497E+01
+-7.6706886E+01 3.6243713E+01
+ 50 34464 25 48 16 15 2
+-7.9138199E+01 3.6541599E+01-7.9153999E+01 3.6241982E+01
+ 51 29348 46 48 15 30 2
+-7.9257225E+01 3.6243732E+01-7.9153999E+01 3.6241982E+01
+ 52 29217 44 49 28 13 2
+-7.9532219E+01 3.6249851E+01-7.9532631E+01 3.6241299E+01
+ 53 29268 49 43 27 13 3
+-7.9532631E+01 3.6241299E+01-7.9750000E+01 3.6247082E+01
+-8.0035774E+01 3.6257259E+01
+ 54 39791 42 50 26 4 2
+-8.0452171E+01 3.6261414E+01-8.0452545E+01 3.6241085E+01
+ 55 30077 51 36 2 19 33
+-8.1477699E+01 3.6240067E+01-8.1462898E+01 3.6257557E+01
+-8.1452072E+01 3.6262100E+01-8.1442558E+01 3.6259983E+01
+-8.1430878E+01 3.6265755E+01-8.1429665E+01 3.6271423E+01
+-8.1416122E+01 3.6278328E+01-8.1413116E+01 3.6281876E+01
+-8.1415955E+01 3.6290764E+01-8.1414528E+01 3.6294449E+01
+-8.1408981E+01 3.6293945E+01-8.1405533E+01 3.6290550E+01
+-8.1387383E+01 3.6283333E+01-8.1379524E+01 3.6287968E+01
+-8.1373550E+01 3.6284344E+01-8.1367920E+01 3.6284286E+01
+-8.1367043E+01 3.6302887E+01-8.1363144E+01 3.6304722E+01
+-8.1361588E+01 3.6308956E+01-8.1367027E+01 3.6358807E+01
+-8.1359383E+01 3.6367489E+01-8.1350754E+01 3.6366787E+01
+-8.1343338E+01 3.6371323E+01-8.1334312E+01 3.6369785E+01
+-8.1321686E+01 3.6374691E+01-8.1320267E+01 3.6368095E+01
+-8.1314629E+01 3.6368305E+01-8.1305626E+01 3.6364361E+01
+-8.1295929E+01 3.6366848E+01-8.1278992E+01 3.6358368E+01
+-8.1264694E+01 3.6360638E+01-8.1259224E+01 3.6358711E+01
+-8.1250839E+01 3.6363235E+01
+ 56 30447 51 34 20 2 6
+-8.1477699E+01 3.6240067E+01-8.1555191E+01 3.6275612E+01
+-8.1566711E+01 3.6272190E+01-8.1589691E+01 3.6303333E+01
+-8.1638390E+01 3.6349380E+01-8.1728851E+01 3.6391041E+01
+ 57 38701 52 48 30 16 2
+-7.8951065E+01 3.6239021E+01-7.9153999E+01 3.6241982E+01
+ 58 31009 47 45 29 10 7
+-7.6706886E+01 3.6243713E+01-7.6900269E+01 3.6242920E+01
+-7.6971664E+01 3.6238079E+01-7.6986092E+01 3.6241936E+01
+-7.7009071E+01 3.6239239E+01-7.7183517E+01 3.6242542E+01
+-7.7209106E+01 3.6246719E+01
+ 59 49135 50 53 23 4 45
+-8.0452545E+01 3.6241085E+01-8.0461220E+01 3.6247795E+01
+-8.0464272E+01 3.6258080E+01-8.0470085E+01 3.6260277E+01
+-8.0476662E+01 3.6260437E+01-8.0485306E+01 3.6255615E+01
+-8.0505424E+01 3.6259800E+01-8.0510223E+01 3.6258217E+01
+-8.0534775E+01 3.6258556E+01-8.0537666E+01 3.6262459E+01
+-8.0536942E+01 3.6279293E+01-8.0547699E+01 3.6285107E+01
+-8.0554062E+01 3.6282185E+01-8.0559593E+01 3.6282871E+01
+-8.0574257E+01 3.6279621E+01-8.0592751E+01 3.6269814E+01
+-8.0615425E+01 3.6279388E+01-8.0627876E+01 3.6287552E+01
+-8.0631882E+01 3.6284328E+01-8.0626556E+01 3.6277225E+01
+-8.0627136E+01 3.6273972E+01-8.0643234E+01 3.6271980E+01
+-8.0648369E+01 3.6256332E+01-8.0656509E+01 3.6251530E+01
+-8.0673660E+01 3.6252026E+01-8.0679062E+01 3.6264126E+01
+-8.0684471E+01 3.6268490E+01-8.0702309E+01 3.6265701E+01
+-8.0714127E+01 3.6266800E+01-8.0721344E+01 3.6269882E+01
+-8.0733131E+01 3.6266884E+01-8.0734871E+01 3.6268681E+01
+-8.0732368E+01 3.6276821E+01-8.0738121E+01 3.6279995E+01
+-8.0751785E+01 3.6263283E+01-8.0756477E+01 3.6264469E+01
+-8.0769211E+01 3.6274616E+01-8.0775757E+01 3.6273796E+01
+-8.0780281E+01 3.6268738E+01-8.0778526E+01 3.6256935E+01
+-8.0796097E+01 3.6248108E+01-8.0809441E+01 3.6253906E+01
+-8.0848770E+01 3.6241024E+01-8.0867538E+01 3.6239040E+01
+-8.0873466E+01 3.6236248E+01
+ 60 30170 33 53 4 19 15
+-8.0967583E+01 3.6401577E+01-8.0939575E+01 3.6383316E+01
+-8.0931305E+01 3.6367004E+01-8.0922943E+01 3.6364292E+01
+-8.0916641E+01 3.6367805E+01-8.0912064E+01 3.6362602E+01
+-8.0904663E+01 3.6360874E+01-8.0903511E+01 3.6356689E+01
+-8.0899208E+01 3.6354248E+01-8.0899063E+01 3.6347294E+01
+-8.0895721E+01 3.6342861E+01-8.0878304E+01 3.6334244E+01
+-8.0875641E+01 3.6329567E+01-8.0869087E+01 3.6326317E+01
+-8.0873466E+01 3.6236248E+01
+ 61 41349 26 54 14 16 3
+-7.8796577E+01 3.6541573E+01-7.8795097E+01 3.6526546E+01
+-7.8802277E+01 3.6235798E+01
+ 62 38679 54 52 31 16 2
+-7.8802277E+01 3.6235798E+01-7.8951065E+01 3.6239021E+01
+ 63 154 55 7 6 1 7
+-7.5773750E+01 3.6231594E+01-7.5780441E+01 3.6246700E+01
+-7.5806671E+01 3.6319275E+01-7.5822418E+01 3.6372616E+01
+-7.5855637E+01 3.6488914E+01-7.5867401E+01 3.6550598E+01
+-7.5867432E+01 3.6550755E+01
+ 64 37227 55 56 32 6 2
+-7.5773750E+01 3.6231594E+01-7.5787750E+01 3.6228706E+01
+ 65 42738 32 57 17 11 11
+-7.7898239E+01 3.6506699E+01-7.7907021E+01 3.6491386E+01
+-7.7912025E+01 3.6475296E+01-7.7911987E+01 3.6442696E+01
+-7.7918297E+01 3.6440056E+01-7.7920364E+01 3.6435989E+01
+-7.7917160E+01 3.6427254E+01-7.7912224E+01 3.6424419E+01
+-7.7912315E+01 3.6382126E+01-7.7944427E+01 3.6297245E+01
+-7.8006844E+01 3.6202530E+01
+ 66 40535 57 40 25 11 36
+-7.8006844E+01 3.6202530E+01-7.8016655E+01 3.6207733E+01
+-7.8021706E+01 3.6204666E+01-7.8029327E+01 3.6210300E+01
+-7.8030533E+01 3.6214188E+01-7.8031448E+01 3.6208904E+01
+-7.8035347E+01 3.6206707E+01-7.8039062E+01 3.6208405E+01
+-7.8037994E+01 3.6210506E+01-7.8044937E+01 3.6211609E+01
+-7.8044937E+01 3.6215294E+01-7.8058350E+01 3.6210789E+01
+-7.8060890E+01 3.6213989E+01-7.8071480E+01 3.6216415E+01
+-7.8077354E+01 3.6211494E+01-7.8083336E+01 3.6212524E+01
+-7.8085167E+01 3.6209209E+01-7.8091667E+01 3.6207649E+01
+-7.8098663E+01 3.6210644E+01-7.8103302E+01 3.6209003E+01
+-7.8110664E+01 3.6210300E+01-7.8110580E+01 3.6215813E+01
+-7.8112305E+01 3.6217392E+01-7.8114738E+01 3.6216106E+01
+-7.8119347E+01 3.6224159E+01-7.8125992E+01 3.6225849E+01
+-7.8125702E+01 3.6234570E+01-7.8133064E+01 3.6246174E+01
+-7.8149704E+01 3.6246498E+01-7.8157867E+01 3.6244373E+01
+-7.8173691E+01 3.6255314E+01-7.8193993E+01 3.6246670E+01
+-7.8198830E+01 3.6251652E+01-7.8215950E+01 3.6251850E+01
+-7.8224823E+01 3.6256428E+01-7.8307083E+01 3.6265949E+01
+ 67 41366 58 22 14 12 26
+-7.8496819E+01 3.6174950E+01-7.8508919E+01 3.6182674E+01
+-7.8511574E+01 3.6267376E+01-7.8511536E+01 3.6454140E+01
+-7.8503098E+01 3.6490639E+01-7.8504738E+01 3.6495380E+01
+-7.8501381E+01 3.6497780E+01-7.8500359E+01 3.6503960E+01
+-7.8495163E+01 3.6507992E+01-7.8497833E+01 3.6514538E+01
+-7.8493668E+01 3.6518017E+01-7.8485840E+01 3.6516487E+01
+-7.8480591E+01 3.6517841E+01-7.8475861E+01 3.6521847E+01
+-7.8470840E+01 3.6522236E+01-7.8470703E+01 3.6525669E+01
+-7.8466621E+01 3.6523933E+01-7.8465714E+01 3.6525513E+01
+-7.8469543E+01 3.6526314E+01-7.8467361E+01 3.6532032E+01
+-7.8464226E+01 3.6533482E+01-7.8458878E+01 3.6531803E+01
+-7.8455711E+01 3.6533859E+01-7.8456192E+01 3.6538418E+01
+-7.8453766E+01 3.6539776E+01-7.8457245E+01 3.6542332E+01
+ 68 31140 45 59 29 9 17
+-7.7209106E+01 3.6246719E+01-7.7229218E+01 3.6217289E+01
+-7.7228966E+01 3.6214306E+01-7.7245010E+01 3.6214924E+01
+-7.7253357E+01 3.6219002E+01-7.7264175E+01 3.6217010E+01
+-7.7270195E+01 3.6213055E+01-7.7275703E+01 3.6214336E+01
+-7.7288185E+01 3.6211094E+01-7.7290749E+01 3.6212624E+01
+-7.7298073E+01 3.6208023E+01-7.7298073E+01 3.6202988E+01
+-7.7293663E+01 3.6196445E+01-7.7300049E+01 3.6181065E+01
+-7.7295776E+01 3.6174259E+01-7.7298370E+01 3.6172188E+01
+-7.7291679E+01 3.6168198E+01
+ 69 42726 32 59 9 17 64
+-7.7898239E+01 3.6506699E+01-7.7892502E+01 3.6511887E+01
+-7.7885506E+01 3.6506355E+01-7.7876884E+01 3.6506264E+01
+-7.7871277E+01 3.6503796E+01-7.7865921E+01 3.6503281E+01
+-7.7858688E+01 3.6506508E+01-7.7833626E+01 3.6500854E+01
+-7.7817490E+01 3.6500351E+01-7.7787766E+01 3.6490559E+01
+-7.7775719E+01 3.6482304E+01-7.7768761E+01 3.6480385E+01
+-7.7763367E+01 3.6482021E+01-7.7753624E+01 3.6478729E+01
+-7.7744553E+01 3.6479134E+01-7.7726143E+01 3.6487415E+01
+-7.7710312E+01 3.6487087E+01-7.7681313E+01 3.6479057E+01
+-7.7645790E+01 3.6480808E+01-7.7639679E+01 3.6474789E+01
+-7.7631134E+01 3.6450253E+01-7.7625000E+01 3.6444641E+01
+-7.7616371E+01 3.6443703E+01-7.7610817E+01 3.6437183E+01
+-7.7592262E+01 3.6431244E+01-7.7587082E+01 3.6422070E+01
+-7.7581070E+01 3.6424034E+01-7.7573570E+01 3.6422985E+01
+-7.7556274E+01 3.6418045E+01-7.7549927E+01 3.6412117E+01
+-7.7544838E+01 3.6393967E+01-7.7547874E+01 3.6372635E+01
+-7.7573959E+01 3.6357212E+01-7.7579819E+01 3.6350891E+01
+-7.7586342E+01 3.6336864E+01-7.7577522E+01 3.6327984E+01
+-7.7571854E+01 3.6314095E+01-7.7557663E+01 3.6305534E+01
+-7.7543869E+01 3.6302902E+01-7.7524361E+01 3.6306652E+01
+-7.7495773E+01 3.6307949E+01-7.7485321E+01 3.6315983E+01
+-7.7476639E+01 3.6316971E+01-7.7468498E+01 3.6321117E+01
+-7.7444542E+01 3.6324490E+01-7.7439568E+01 3.6322083E+01
+-7.7434761E+01 3.6313820E+01-7.7414597E+01 3.6292763E+01
+-7.7410255E+01 3.6263374E+01-7.7383392E+01 3.6250469E+01
+-7.7378311E+01 3.6246002E+01-7.7377586E+01 3.6235592E+01
+-7.7387032E+01 3.6213509E+01-7.7384865E+01 3.6209160E+01
+-7.7358582E+01 3.6197441E+01-7.7351212E+01 3.6191124E+01
+-7.7342201E+01 3.6189548E+01-7.7329811E+01 3.6192207E+01
+-7.7320206E+01 3.6181797E+01-7.7308998E+01 3.6180099E+01
+-7.7313629E+01 3.6173691E+01-7.7308662E+01 3.6167561E+01
+-7.7298973E+01 3.6164810E+01-7.7291679E+01 3.6168198E+01
+ 70 40558 58 40 12 25 17
+-7.8496819E+01 3.6174950E+01-7.8496017E+01 3.6180229E+01
+-7.8492661E+01 3.6183247E+01-7.8485207E+01 3.6178928E+01
+-7.8485855E+01 3.6174534E+01-7.8466629E+01 3.6172089E+01
+-7.8461014E+01 3.6169571E+01-7.8458420E+01 3.6163509E+01
+-7.8450233E+01 3.6168865E+01-7.8432053E+01 3.6166531E+01
+-7.8432503E+01 3.6164310E+01-7.8421951E+01 3.6164265E+01
+-7.8422173E+01 3.6167854E+01-7.8412331E+01 3.6169525E+01
+-7.8378448E+01 3.6234940E+01-7.8338234E+01 3.6234474E+01
+-7.8307083E+01 3.6265949E+01
+ 71 34091 31 60 7 18 65
+-7.6491806E+01 3.6510384E+01-7.6437561E+01 3.6467739E+01
+-7.6423584E+01 3.6464462E+01-7.6407097E+01 3.6453861E+01
+-7.6394768E+01 3.6454315E+01-7.6387711E+01 3.6447056E+01
+-7.6377113E+01 3.6445492E+01-7.6375893E+01 3.6441967E+01
+-7.6371834E+01 3.6441463E+01-7.6372459E+01 3.6439423E+01
+-7.6368233E+01 3.6439816E+01-7.6369507E+01 3.6434917E+01
+-7.6364746E+01 3.6429424E+01-7.6358078E+01 3.6426289E+01
+-7.6347969E+01 3.6427872E+01-7.6348984E+01 3.6423248E+01
+-7.6345619E+01 3.6421139E+01-7.6338539E+01 3.6424599E+01
+-7.6329323E+01 3.6423637E+01-7.6322372E+01 3.6427208E+01
+-7.6320488E+01 3.6422405E+01-7.6323433E+01 3.6417072E+01
+-7.6310600E+01 3.6405575E+01-7.6310944E+01 3.6401894E+01
+-7.6302193E+01 3.6400406E+01-7.6300941E+01 3.6395527E+01
+-7.6292313E+01 3.6386711E+01-7.6287811E+01 3.6384876E+01
+-7.6285568E+01 3.6388725E+01-7.6280159E+01 3.6386250E+01
+-7.6273880E+01 3.6388031E+01-7.6259071E+01 3.6383835E+01
+-7.6259552E+01 3.6376465E+01-7.6257042E+01 3.6372860E+01
+-7.6260559E+01 3.6366310E+01-7.6257812E+01 3.6363380E+01
+-7.6244263E+01 3.6365669E+01-7.6238815E+01 3.6371029E+01
+-7.6231560E+01 3.6371555E+01-7.6231712E+01 3.6361450E+01
+-7.6226578E+01 3.6355133E+01-7.6227974E+01 3.6348667E+01
+-7.6214874E+01 3.6341686E+01-7.6218597E+01 3.6333416E+01
+-7.6216454E+01 3.6327480E+01-7.6191696E+01 3.6327950E+01
+-7.6181725E+01 3.6321804E+01-7.6183487E+01 3.6316948E+01
+-7.6188774E+01 3.6314423E+01-7.6200111E+01 3.6317814E+01
+-7.6201569E+01 3.6305000E+01-7.6212570E+01 3.6304493E+01
+-7.6217392E+01 3.6301357E+01-7.6217415E+01 3.6298252E+01
+-7.6204910E+01 3.6296665E+01-7.6197998E+01 3.6291145E+01
+-7.6179665E+01 3.6292801E+01-7.6172546E+01 3.6282555E+01
+-7.6165375E+01 3.6277191E+01-7.6147232E+01 3.6276291E+01
+-7.6137955E+01 3.6273167E+01-7.6121078E+01 3.6259972E+01
+-7.6098473E+01 3.6227028E+01-7.6068077E+01 3.6215179E+01
+-7.6032944E+01 3.6162350E+01
+ 72 34083 10 62 6 7 52
+-7.6313553E+01 3.6550400E+01-7.6158905E+01 3.6426128E+01
+-7.6157990E+01 3.6398064E+01-7.6148338E+01 3.6394581E+01
+-7.6122467E+01 3.6371098E+01-7.6114899E+01 3.6357292E+01
+-7.6087265E+01 3.6349770E+01-7.6085258E+01 3.6351875E+01
+-7.6079903E+01 3.6347019E+01-7.6075317E+01 3.6348419E+01
+-7.6074928E+01 3.6345947E+01-7.6072372E+01 3.6349815E+01
+-7.6063774E+01 3.6347595E+01-7.6065140E+01 3.6351170E+01
+-7.6059525E+01 3.6352085E+01-7.6053726E+01 3.6360027E+01
+-7.6049644E+01 3.6356297E+01-7.6046104E+01 3.6358143E+01
+-7.6042336E+01 3.6355354E+01-7.6037270E+01 3.6355206E+01
+-7.6028725E+01 3.6348141E+01-7.6028748E+01 3.6344170E+01
+-7.6033730E+01 3.6341118E+01-7.6032242E+01 3.6338516E+01
+-7.6025620E+01 3.6340435E+01-7.6023003E+01 3.6345005E+01
+-7.6016953E+01 3.6344212E+01-7.6020721E+01 3.6332588E+01
+-7.6016571E+01 3.6326992E+01-7.6008560E+01 3.6328541E+01
+-7.6002266E+01 3.6323620E+01-7.6000000E+01 3.6311024E+01
+-7.5991394E+01 3.6308109E+01-7.5976845E+01 3.6310246E+01
+-7.5971382E+01 3.6308228E+01-7.5967216E+01 3.6289753E+01
+-7.5962074E+01 3.6287243E+01-7.5955711E+01 3.6289242E+01
+-7.5948654E+01 3.6284805E+01-7.5950821E+01 3.6279545E+01
+-7.5949463E+01 3.6273659E+01-7.5963020E+01 3.6266560E+01
+-7.5963608E+01 3.6258450E+01-7.5952950E+01 3.6252949E+01
+-7.5935173E+01 3.6238308E+01-7.5931610E+01 3.6229515E+01
+-7.5929420E+01 3.6205635E+01-7.5926033E+01 3.6198856E+01
+-7.5919090E+01 3.6192158E+01-7.5899071E+01 3.6180386E+01
+-7.5889542E+01 3.6167252E+01-7.5888496E+01 3.6154503E+01
+ 73 160 60 62 7 1 4
+-7.6032944E+01 3.6162350E+01-7.6032150E+01 3.6162788E+01
+-7.5997139E+01 3.6175392E+01-7.5888496E+01 3.6154503E+01
+ 74 39283 57 63 17 33 61
+-7.8006844E+01 3.6202530E+01-7.8001640E+01 3.6198505E+01
+-7.7997231E+01 3.6198277E+01-7.7997169E+01 3.6192303E+01
+-7.7992477E+01 3.6185032E+01-7.7988083E+01 3.6189381E+01
+-7.7983871E+01 3.6186821E+01-7.7984657E+01 3.6180714E+01
+-7.7978363E+01 3.6175133E+01-7.7971870E+01 3.6178108E+01
+-7.7969727E+01 3.6183231E+01-7.7973686E+01 3.6189842E+01
+-7.7973289E+01 3.6194191E+01-7.7968040E+01 3.6194099E+01
+-7.7951866E+01 3.6180603E+01-7.7945145E+01 3.6181889E+01
+-7.7944862E+01 3.6192368E+01-7.7941734E+01 3.6192162E+01
+-7.7931122E+01 3.6182049E+01-7.7926636E+01 3.6183125E+01
+-7.7924660E+01 3.6188751E+01-7.7918388E+01 3.6179646E+01
+-7.7923676E+01 3.6166603E+01-7.7917580E+01 3.6163696E+01
+-7.7909760E+01 3.6165230E+01-7.7901749E+01 3.6162758E+01
+-7.7902084E+01 3.6156349E+01-7.7892860E+01 3.6150833E+01
+-7.7888214E+01 3.6143711E+01-7.7885368E+01 3.6147121E+01
+-7.7879700E+01 3.6143116E+01-7.7879524E+01 3.6144672E+01
+-7.7861725E+01 3.6148880E+01-7.7856758E+01 3.6145950E+01
+-7.7848549E+01 3.6144974E+01-7.7822090E+01 3.6144634E+01
+-7.7815636E+01 3.6139786E+01-7.7808266E+01 3.6138161E+01
+-7.7804657E+01 3.6149574E+01-7.7800201E+01 3.6144451E+01
+-7.7792465E+01 3.6144993E+01-7.7783554E+01 3.6141174E+01
+-7.7779076E+01 3.6143806E+01-7.7774498E+01 3.6142342E+01
+-7.7773422E+01 3.6146576E+01-7.7755852E+01 3.6149864E+01
+-7.7753418E+01 3.6157162E+01-7.7750000E+01 3.6156986E+01
+-7.7745903E+01 3.6152809E+01-7.7741615E+01 3.6155006E+01
+-7.7737900E+01 3.6153660E+01-7.7732979E+01 3.6147324E+01
+-7.7729851E+01 3.6148880E+01-7.7731819E+01 3.6139248E+01
+-7.7722023E+01 3.6133755E+01-7.7716972E+01 3.6135818E+01
+-7.7721832E+01 3.6141518E+01-7.7716583E+01 3.6146023E+01
+-7.7707695E+01 3.6146164E+01-7.7705414E+01 3.6150764E+01
+-7.7698235E+01 3.6152775E+01
+ 75 30440 64 51 20 19 6
+-8.1545631E+01 3.6117268E+01-8.1500000E+01 3.6142708E+01
+-8.1477760E+01 3.6180767E+01-8.1465805E+01 3.6189365E+01
+-8.1461365E+01 3.6204769E+01-8.1477699E+01 3.6240067E+01
+ 76 160 65 60 18 1 6
+-7.6184258E+01 3.6113159E+01-7.6173592E+01 3.6122177E+01
+-7.6141380E+01 3.6131981E+01-7.6095169E+01 3.6133381E+01
+-7.6060158E+01 3.6147385E+01-7.6032944E+01 3.6162350E+01
+ 77 34140 35 65 18 21 33
+-7.6454025E+01 3.6377888E+01-7.6447922E+01 3.6363472E+01
+-7.6402115E+01 3.6301437E+01-7.6394966E+01 3.6296570E+01
+-7.6392281E+01 3.6287281E+01-7.6381210E+01 3.6275436E+01
+-7.6376709E+01 3.6274883E+01-7.6378075E+01 3.6268475E+01
+-7.6375420E+01 3.6258698E+01-7.6361374E+01 3.6252403E+01
+-7.6348312E+01 3.6249443E+01-7.6341301E+01 3.6241386E+01
+-7.6337715E+01 3.6240471E+01-7.6332458E+01 3.6243977E+01
+-7.6325081E+01 3.6240131E+01-7.6318016E+01 3.6240200E+01
+-7.6315475E+01 3.6233147E+01-7.6307953E+01 3.6230129E+01
+-7.6304001E+01 3.6221630E+01-7.6290291E+01 3.6223053E+01
+-7.6290169E+01 3.6217865E+01-7.6285362E+01 3.6215836E+01
+-7.6288742E+01 3.6212959E+01-7.6280449E+01 3.6203033E+01
+-7.6279648E+01 3.6198090E+01-7.6273621E+01 3.6195019E+01
+-7.6272270E+01 3.6185562E+01-7.6260223E+01 3.6179367E+01
+-7.6251755E+01 3.6169331E+01-7.6240669E+01 3.6163601E+01
+-7.6215858E+01 3.6130203E+01-7.6195015E+01 3.6117580E+01
+-7.6184258E+01 3.6113159E+01
+ 78 33860 66 64 20 36 4
+-8.1811691E+01 3.6111416E+01-8.1674950E+01 3.6122353E+01
+-8.1660957E+01 3.6118217E+01-8.1545631E+01 3.6117268E+01
+ 79 30657 66 39 24 20 23
+-8.1811691E+01 3.6111416E+01-8.1829468E+01 3.6168865E+01
+-8.1835358E+01 3.6168339E+01-8.1856987E+01 3.6193611E+01
+-8.1885689E+01 3.6189373E+01-8.1888710E+01 3.6196602E+01
+-8.1901901E+01 3.6205898E+01-8.1908203E+01 3.6214489E+01
+-8.1907776E+01 3.6223488E+01-8.1911530E+01 3.6229420E+01
+-8.1908051E+01 3.6234573E+01-8.1908394E+01 3.6239147E+01
+-8.1902901E+01 3.6239014E+01-8.1897392E+01 3.6242489E+01
+-8.1904312E+01 3.6250874E+01-8.1902451E+01 3.6254051E+01
+-8.1901344E+01 3.6252014E+01-8.1896622E+01 3.6255196E+01
+-8.1897209E+01 3.6261608E+01-8.1893791E+01 3.6264194E+01
+-8.1900314E+01 3.6280708E+01-8.1907639E+01 3.6278374E+01
+-8.1918335E+01 3.6286903E+01
+ 80 30635 41 67 24 1 9
+-8.1933159E+01 3.6264759E+01-8.1960266E+01 3.6228008E+01
+-8.2029503E+01 3.6123402E+01-8.2035301E+01 3.6120499E+01
+-8.2044106E+01 3.6125301E+01-8.2054306E+01 3.6126701E+01
+-8.2061501E+01 3.6112999E+01-8.2079903E+01 3.6106400E+01
+-8.2080597E+01 3.6102901E+01
+ 81 30635 67 61 34 1 19
+-8.2080597E+01 3.6102901E+01-8.2086105E+01 3.6105900E+01
+-8.2098701E+01 3.6105598E+01-8.2105598E+01 3.6108002E+01
+-8.2115402E+01 3.6104500E+01-8.2130402E+01 3.6104401E+01
+-8.2138130E+01 3.6119461E+01-8.2136703E+01 3.6128700E+01
+-8.2148102E+01 3.6149399E+01-8.2159203E+01 3.6145699E+01
+-8.2172302E+01 3.6146301E+01-8.2177002E+01 3.6142101E+01
+-8.2184402E+01 3.6144798E+01-8.2187599E+01 3.6151001E+01
+-8.2192101E+01 3.6148701E+01-8.2195503E+01 3.6149899E+01
+-8.2203712E+01 3.6157345E+01-8.2213997E+01 3.6159000E+01
+-8.2222198E+01 3.6156799E+01
+ 82 31112 68 59 17 29 20
+-7.7327950E+01 3.6074780E+01-7.7319740E+01 3.6078793E+01
+-7.7312950E+01 3.6088882E+01-7.7292961E+01 3.6090878E+01
+-7.7283905E+01 3.6096321E+01-7.7273247E+01 3.6099178E+01
+-7.7243256E+01 3.6096859E+01-7.7230598E+01 3.6105129E+01
+-7.7233170E+01 3.6110207E+01-7.7252190E+01 3.6114853E+01
+-7.7251228E+01 3.6117458E+01-7.7240059E+01 3.6119865E+01
+-7.7254585E+01 3.6122086E+01-7.7251923E+01 3.6135384E+01
+-7.7266594E+01 3.6140293E+01-7.7267883E+01 3.6150089E+01
+-7.7263672E+01 3.6158669E+01-7.7276062E+01 3.6156864E+01
+-7.7284019E+01 3.6167278E+01-7.7291679E+01 3.6168198E+01
+ 83 30694 61 69 34 1 24
+-8.2222198E+01 3.6156799E+01-8.2229408E+01 3.6144424E+01
+-8.2241707E+01 3.6137001E+01-8.2245201E+01 3.6130901E+01
+-8.2251999E+01 3.6132099E+01-8.2254601E+01 3.6135899E+01
+-8.2260506E+01 3.6133598E+01-8.2264397E+01 3.6127102E+01
+-8.2266907E+01 3.6126801E+01-8.2274200E+01 3.6129299E+01
+-8.2280502E+01 3.6128700E+01-8.2289597E+01 3.6135601E+01
+-8.2303596E+01 3.6130901E+01-8.2318306E+01 3.6120800E+01
+-8.2336197E+01 3.6114899E+01-8.2347000E+01 3.6115101E+01
+-8.2350105E+01 3.6117001E+01-8.2355301E+01 3.6115501E+01
+-8.2364601E+01 3.6107407E+01-8.2375702E+01 3.6105499E+01
+-8.2380600E+01 3.6099201E+01-8.2390106E+01 3.6096802E+01
+-8.2404602E+01 3.6087502E+01-8.2416809E+01 3.6072731E+01
+ 84 160 62 56 6 1 48
+-7.5888496E+01 3.6154503E+01-7.5887947E+01 3.6154400E+01
+-7.5846893E+01 3.6100670E+01-7.5811920E+01 3.6077061E+01
+-7.5796181E+01 3.6070065E+01-7.5789185E+01 3.6079685E+01
+-7.5798805E+01 3.6112038E+01-7.5821541E+01 3.6159256E+01
+-7.5832909E+01 3.6167999E+01-7.5848648E+01 3.6213470E+01
+-7.5862640E+01 3.6235332E+01-7.5876534E+01 3.6279453E+01
+-7.5883034E+01 3.6284805E+01-7.5890678E+01 3.6298943E+01
+-7.5897179E+01 3.6322250E+01-7.5907112E+01 3.6333717E+01
+-7.5915138E+01 3.6350910E+01-7.5921631E+01 3.6370785E+01
+-7.5916283E+01 3.6386070E+01-7.5925072E+01 3.6425049E+01
+-7.5931183E+01 3.6428490E+01-7.5990417E+01 3.6436516E+01
+-7.6007614E+01 3.6443394E+01-7.6014870E+01 3.6450653E+01
+-7.6022896E+01 3.6465939E+01-7.6020988E+01 3.6485813E+01
+-7.6004173E+01 3.6493450E+01-7.5987358E+01 3.6493450E+01
+-7.5975899E+01 3.6485046E+01-7.5972069E+01 3.6486958E+01
+-7.5970543E+01 3.6492310E+01-7.5962906E+01 3.6493835E+01
+-7.5939590E+01 3.6489632E+01-7.5926216E+01 3.6482754E+01
+-7.5905586E+01 3.6478168E+01-7.5899467E+01 3.6472435E+01
+-7.5898705E+01 3.6464790E+01-7.5892586E+01 3.6460587E+01
+-7.5886475E+01 3.6439186E+01-7.5863159E+01 3.6431549E+01
+-7.5857048E+01 3.6425049E+01-7.5851692E+01 3.6402885E+01
+-7.5849785E+01 3.6378048E+01-7.5835266E+01 3.6355499E+01
+-7.5821892E+01 3.6292442E+01-7.5805984E+01 3.6266441E+01
+-7.5799690E+01 3.6249115E+01-7.5787750E+01 3.6228706E+01
+ 85 38661 54 70 14 31 14
+-7.8802277E+01 3.6235798E+01-7.8805595E+01 3.6093758E+01
+-7.8803253E+01 3.6089436E+01-7.8807831E+01 3.6087502E+01
+-7.8798698E+01 3.6084126E+01-7.8793953E+01 3.6086582E+01
+-7.8791267E+01 3.6081165E+01-7.8793503E+01 3.6077328E+01
+-7.8790222E+01 3.6078465E+01-7.8785477E+01 3.6076630E+01
+-7.8788368E+01 3.6072021E+01-7.8783997E+01 3.6069408E+01
+-7.8780891E+01 3.6071827E+01-7.8749275E+01 3.6071098E+01
+ 86 160 71 65 21 1 8
+-7.6403259E+01 3.6067844E+01-7.6382256E+01 3.6080166E+01
+-7.6333237E+01 3.6082966E+01-7.6267418E+01 3.6106773E+01
+-7.6229607E+01 3.6096970E+01-7.6212799E+01 3.6096970E+01
+-7.6191803E+01 3.6106773E+01-7.6184258E+01 3.6113159E+01
+ 87 31066 71 37 22 21 27
+-7.6403259E+01 3.6067844E+01-7.6404144E+01 3.6073883E+01
+-7.6436714E+01 3.6076836E+01-7.6446037E+01 3.6075722E+01
+-7.6448807E+01 3.6079857E+01-7.6455688E+01 3.6080059E+01
+-7.6460815E+01 3.6087833E+01-7.6472900E+01 3.6089077E+01
+-7.6478844E+01 3.6093117E+01-7.6491745E+01 3.6084591E+01
+-7.6500504E+01 3.6085396E+01-7.6518097E+01 3.6097080E+01
+-7.6539513E+01 3.6094383E+01-7.6548164E+01 3.6098965E+01
+-7.6560158E+01 3.6100777E+01-7.6573242E+01 3.6110600E+01
+-7.6590202E+01 3.6238590E+01-7.6587120E+01 3.6248802E+01
+-7.6572960E+01 3.6257626E+01-7.6567924E+01 3.6275543E+01
+-7.6568298E+01 3.6286968E+01-7.6565697E+01 3.6293652E+01
+-7.6568810E+01 3.6310547E+01-7.6561821E+01 3.6322132E+01
+-7.6563797E+01 3.6326302E+01-7.6560097E+01 3.6335278E+01
+-7.6559784E+01 3.6351181E+01
+ 88 49200 53 72 23 19 2
+-8.0873466E+01 3.6236248E+01-8.0882385E+01 3.6055599E+01
+ 89 38049 73 72 42 23 2
+-8.0692909E+01 3.6050964E+01-8.0882385E+01 3.6055599E+01
+ 90 39792 50 74 26 23 20
+-8.0452545E+01 3.6241085E+01-8.0437523E+01 3.6229492E+01
+-8.0432190E+01 3.6217087E+01-8.0442871E+01 3.6212879E+01
+-8.0446548E+01 3.6207561E+01-8.0439751E+01 3.6190441E+01
+-8.0443993E+01 3.6181984E+01-8.0436974E+01 3.6169800E+01
+-8.0443390E+01 3.6154243E+01-8.0439400E+01 3.6137299E+01
+-8.0453934E+01 3.6122223E+01-8.0461502E+01 3.6118305E+01
+-8.0487663E+01 3.6115761E+01-8.0507576E+01 3.6107544E+01
+-8.0510078E+01 3.6098293E+01-8.0516281E+01 3.6092339E+01
+-8.0516640E+01 3.6082703E+01-8.0509827E+01 3.6072330E+01
+-8.0506981E+01 3.6053856E+01-8.0496628E+01 3.6046398E+01
+ 91 37984 74 73 41 23 2
+-8.0496628E+01 3.6046398E+01-8.0692909E+01 3.6050964E+01
+ 92 43746 72 75 42 19 3
+-8.0882385E+01 3.6055599E+01-8.0976753E+01 3.6057743E+01
+-8.1029350E+01 3.6045567E+01
+ 93 31004 77 47 29 22 11
+-7.6683327E+01 3.6031960E+01-7.6689964E+01 3.6038757E+01
+-7.6708923E+01 3.6068001E+01-7.6710533E+01 3.6097435E+01
+-7.6731842E+01 3.6133251E+01-7.6736656E+01 3.6146885E+01
+-7.6737671E+01 3.6159904E+01-7.6732727E+01 3.6214684E+01
+-7.6728752E+01 3.6220497E+01-7.6716446E+01 3.6228451E+01
+-7.6706886E+01 3.6243713E+01
+ 94 40366 78 58 14 25 3
+-7.8546776E+01 3.6021656E+01-7.8545074E+01 3.6080490E+01
+-7.8496819E+01 3.6174950E+01
+ 95 38749 70 78 14 38 5
+-7.8749275E+01 3.6071098E+01-7.8715836E+01 3.6076088E+01
+-7.8683609E+01 3.6074394E+01-7.8604027E+01 3.6041809E+01
+-7.8546776E+01 3.6021656E+01
+ 96 39733 79 43 26 27 2
+-8.0043404E+01 3.6010300E+01-8.0035774E+01 3.6257259E+01
+ 97 160 77 71 22 1 9
+-7.6683327E+01 3.6031960E+01-7.6665138E+01 3.6042351E+01
+-7.6646927E+01 3.6035351E+01-7.6600723E+01 3.6029747E+01
+-7.6576912E+01 3.6007343E+01-7.6497086E+01 3.6012943E+01
+-7.6460678E+01 3.6024147E+01-7.6446671E+01 3.6042351E+01
+-7.6403259E+01 3.6067844E+01
+ 98 31113 80 68 17 39 2
+-7.7403008E+01 3.6004776E+01-7.7327950E+01 3.6074780E+01
+ 99 39278 80 63 35 17 92
+-7.7403008E+01 3.6004776E+01-7.7408791E+01 3.6006718E+01
+-7.7421700E+01 3.6003284E+01-7.7428230E+01 3.6005001E+01
+-7.7435699E+01 3.6013012E+01-7.7441864E+01 3.6014523E+01
+-7.7438255E+01 3.6018276E+01-7.7439583E+01 3.6020950E+01
+-7.7454544E+01 3.6029469E+01-7.7467903E+01 3.6031548E+01
+-7.7474693E+01 3.6037292E+01-7.7527138E+01 3.6037334E+01
+-7.7529526E+01 3.6039444E+01-7.7524376E+01 3.6040085E+01
+-7.7523079E+01 3.6045280E+01-7.7525978E+01 3.6047592E+01
+-7.7529358E+01 3.6047020E+01-7.7529839E+01 3.6050339E+01
+-7.7532173E+01 3.6049812E+01-7.7533752E+01 3.6052078E+01
+-7.7532677E+01 3.6055557E+01-7.7535614E+01 3.6054573E+01
+-7.7540489E+01 3.6060936E+01-7.7538910E+01 3.6064552E+01
+-7.7536308E+01 3.6063179E+01-7.7529778E+01 3.6068581E+01
+-7.7525887E+01 3.6068714E+01-7.7528702E+01 3.6073040E+01
+-7.7531494E+01 3.6072651E+01-7.7531181E+01 3.6075764E+01
+-7.7535744E+01 3.6077484E+01-7.7536034E+01 3.6080093E+01
+-7.7531967E+01 3.6083340E+01-7.7533768E+01 3.6090572E+01
+-7.7539017E+01 3.6090965E+01-7.7541161E+01 3.6095860E+01
+-7.7553871E+01 3.6099751E+01-7.7554016E+01 3.6097599E+01
+-7.7560951E+01 3.6094193E+01-7.7563354E+01 3.6096985E+01
+-7.7570030E+01 3.6098240E+01-7.7570427E+01 3.6096592E+01
+-7.7574989E+01 3.6099499E+01-7.7579842E+01 3.6097576E+01
+-7.7579727E+01 3.6100437E+01-7.7586388E+01 3.6099976E+01
+-7.7585434E+01 3.6102657E+01-7.7587547E+01 3.6101532E+01
+-7.7590195E+01 3.6103500E+01-7.7592590E+01 3.6101509E+01
+-7.7594223E+01 3.6103981E+01-7.7596367E+01 3.6100433E+01
+-7.7601059E+01 3.6106060E+01-7.7605309E+01 3.6107063E+01
+-7.7605995E+01 3.6110016E+01-7.7610474E+01 3.6107361E+01
+-7.7608955E+01 3.6110199E+01-7.7623169E+01 3.6110561E+01
+-7.7625679E+01 3.6114292E+01-7.7627068E+01 3.6111156E+01
+-7.7627464E+01 3.6114681E+01-7.7630592E+01 3.6115257E+01
+-7.7628502E+01 3.6119396E+01-7.7631859E+01 3.6118713E+01
+-7.7629936E+01 3.6121983E+01-7.7632080E+01 3.6122532E+01
+-7.7632324E+01 3.6126724E+01-7.7637260E+01 3.6127964E+01
+-7.7636978E+01 3.6131531E+01-7.7643829E+01 3.6135380E+01
+-7.7644394E+01 3.6137875E+01-7.7649727E+01 3.6137260E+01
+-7.7652039E+01 3.6135220E+01-7.7655930E+01 3.6138817E+01
+-7.7659714E+01 3.6136688E+01-7.7661858E+01 3.6138245E+01
+-7.7663551E+01 3.6135979E+01-7.7666168E+01 3.6138569E+01
+-7.7667831E+01 3.6136349E+01-7.7670486E+01 3.6136990E+01
+-7.7668938E+01 3.6139412E+01-7.7672546E+01 3.6140808E+01
+-7.7672409E+01 3.6142918E+01-7.7677200E+01 3.6143692E+01
+-7.7672379E+01 3.6147949E+01-7.7679375E+01 3.6150654E+01
+-7.7678749E+01 3.6154152E+01-7.7683266E+01 3.6153214E+01
+-7.7683151E+01 3.6151245E+01-7.7687126E+01 3.6152870E+01
+-7.7694717E+01 3.6151039E+01-7.7698235E+01 3.6152775E+01
+ 100 33873 81 64 36 19 31
+-8.1328575E+01 3.5996422E+01-8.1344330E+01 3.6022629E+01
+-8.1366081E+01 3.6032589E+01-8.1369560E+01 3.6040073E+01
+-8.1374870E+01 3.6036987E+01-8.1376877E+01 3.6040657E+01
+-8.1380295E+01 3.6040569E+01-8.1381660E+01 3.6044479E+01
+-8.1395752E+01 3.6040993E+01-8.1396881E+01 3.6042820E+01
+-8.1391914E+01 3.6046646E+01-8.1390793E+01 3.6051487E+01
+-8.1410370E+01 3.6071949E+01-8.1417206E+01 3.6071140E+01
+-8.1424675E+01 3.6077839E+01-8.1444214E+01 3.6072281E+01
+-8.1447624E+01 3.6083324E+01-8.1452942E+01 3.6086918E+01
+-8.1453178E+01 3.6089985E+01-8.1461784E+01 3.6090347E+01
+-8.1469391E+01 3.6084736E+01-8.1469467E+01 3.6087059E+01
+-8.1477837E+01 3.6092373E+01-8.1477844E+01 3.6096607E+01
+-8.1493759E+01 3.6097195E+01-8.1495743E+01 3.6100220E+01
+-8.1498566E+01 3.6100273E+01-8.1508865E+01 3.6096973E+01
+-8.1517014E+01 3.6097305E+01-8.1520515E+01 3.6102379E+01
+-8.1545631E+01 3.6117268E+01
+ 101 30048 81 75 19 43 29
+-8.1328575E+01 3.5996422E+01-8.1326591E+01 3.5994659E+01
+-8.1317963E+01 3.5996799E+01-8.1312965E+01 3.6004745E+01
+-8.1301384E+01 3.6003979E+01-8.1283958E+01 3.6012947E+01
+-8.1282951E+01 3.6017590E+01-8.1268082E+01 3.6024937E+01
+-8.1252869E+01 3.6025272E+01-8.1249710E+01 3.6027058E+01
+-8.1244720E+01 3.6025024E+01-8.1237793E+01 3.6030392E+01
+-8.1219597E+01 3.6029625E+01-8.1212112E+01 3.6033627E+01
+-8.1207764E+01 3.6032173E+01-8.1202827E+01 3.6036579E+01
+-8.1196114E+01 3.6034916E+01-8.1191101E+01 3.6036819E+01
+-8.1175995E+01 3.6031052E+01-8.1170036E+01 3.6025394E+01
+-8.1139923E+01 3.6037518E+01-8.1123924E+01 3.6037563E+01
+-8.1115936E+01 3.6034351E+01-8.1112549E+01 3.6037582E+01
+-8.1106613E+01 3.6036652E+01-8.1098335E+01 3.6028179E+01
+-8.1057762E+01 3.6031193E+01-8.1048492E+01 3.6041073E+01
+-8.1029350E+01 3.6045567E+01
+ 102 30694 69 82 37 1 7
+-8.2416809E+01 3.6072731E+01-8.2460800E+01 3.6007702E+01
+-8.2476219E+01 3.5998074E+01-8.2482430E+01 3.5997715E+01
+-8.2484825E+01 3.5992741E+01-8.2503807E+01 3.5981895E+01
+-8.2505531E+01 3.5977573E+01
+ 103 37549 83 79 26 44 8
+-8.0394524E+01 3.5972614E+01-8.0351028E+01 3.5988976E+01
+-8.0330215E+01 3.5989071E+01-8.0330444E+01 3.5996223E+01
+-8.0214104E+01 3.5996498E+01-8.0214142E+01 3.6026592E+01
+-8.0149376E+01 3.6026337E+01-8.0043404E+01 3.6010300E+01
+ 104 37982 83 74 41 26 16
+-8.0394524E+01 3.5972614E+01-8.0411530E+01 3.5980125E+01
+-8.0421600E+01 3.5987404E+01-8.0422470E+01 3.5993267E+01
+-8.0413696E+01 3.6000992E+01-8.0418510E+01 3.6015919E+01
+-8.0442909E+01 3.6031120E+01-8.0456383E+01 3.6047825E+01
+-8.0458893E+01 3.6057407E+01-8.0463043E+01 3.6062016E+01
+-8.0468399E+01 3.6062351E+01-8.0473663E+01 3.6059807E+01
+-8.0474380E+01 3.6050655E+01-8.0486847E+01 3.6043102E+01
+-8.0491859E+01 3.6043167E+01-8.0496628E+01 3.6046398E+01
+ 105 30585 84 66 24 36 9
+-8.1807289E+01 3.5961929E+01-8.1735695E+01 3.6067345E+01
+-8.1741547E+01 3.6071663E+01-8.1754089E+01 3.6072487E+01
+-8.1761269E+01 3.6089836E+01-8.1775108E+01 3.6099075E+01
+-8.1785782E+01 3.6100395E+01-8.1796898E+01 3.6107071E+01
+-8.1811691E+01 3.6111416E+01
+ 106 30561 84 85 45 24 13
+-8.1807289E+01 3.5961929E+01-8.1817574E+01 3.5968376E+01
+-8.1833138E+01 3.5967110E+01-8.1835518E+01 3.5971474E+01
+-8.1841187E+01 3.5971958E+01-8.1844696E+01 3.5974857E+01
+-8.1849731E+01 3.5973492E+01-8.1871338E+01 3.5976658E+01
+-8.1877625E+01 3.5981556E+01-8.1877785E+01 3.5989483E+01
+-8.1881180E+01 3.5992767E+01-8.1899750E+01 3.6000000E+01
+-8.1943840E+01 3.5959324E+01
+ 107 33043 82 76 40 1 25
+-8.2505531E+01 3.5977573E+01-8.2517471E+01 3.5975655E+01
+-8.2525391E+01 3.5970852E+01-8.2531433E+01 3.5972080E+01
+-8.2542610E+01 3.5967888E+01-8.2549828E+01 3.5964169E+01
+-8.2558014E+01 3.5953796E+01-8.2575310E+01 3.5958275E+01
+-8.2577858E+01 3.5964088E+01-8.2581146E+01 3.5965450E+01
+-8.2600510E+01 3.5964520E+01-8.2611031E+01 3.5967304E+01
+-8.2611023E+01 3.5974335E+01-8.2604378E+01 3.5987213E+01
+-8.2607079E+01 3.5992065E+01-8.2613167E+01 3.5993896E+01
+-8.2614502E+01 3.6003399E+01-8.2608398E+01 3.6008400E+01
+-8.2608398E+01 3.6015202E+01-8.2602997E+01 3.6017799E+01
+-8.2603401E+01 3.6022900E+01-8.2590797E+01 3.6031898E+01
+-8.2592102E+01 3.6035599E+01-8.2601906E+01 3.6035900E+01
+-8.2603020E+01 3.6039726E+01
+ 108 160 87 77 29 1 7
+-7.6693367E+01 3.5945099E+01-7.6698746E+01 3.5956928E+01
+-7.6697342E+01 3.5975132E+01-7.6680542E+01 3.5990536E+01
+-7.6690346E+01 3.6008743E+01-7.6684746E+01 3.6031147E+01
+-7.6683327E+01 3.6031960E+01
+ 109 160 86 87 47 1 10
+-7.6360397E+01 3.5949467E+01-7.6371048E+01 3.5954128E+01
+-7.6385056E+01 3.5972332E+01-7.6403267E+01 3.5982136E+01
+-7.6490089E+01 3.5959728E+01-7.6532097E+01 3.5942924E+01
+-7.6604919E+01 3.5938725E+01-7.6660934E+01 3.5931721E+01
+-7.6691742E+01 3.5941525E+01-7.6693367E+01 3.5945099E+01
+ 110 33031 88 76 1 40 45
+-8.2898643E+01 3.5945000E+01-8.2892792E+01 3.5945080E+01
+-8.2889267E+01 3.5948235E+01-8.2874298E+01 3.5952595E+01
+-8.2860855E+01 3.5947327E+01-8.2851768E+01 3.5949459E+01
+-8.2845978E+01 3.5946213E+01-8.2844727E+01 3.5941959E+01
+-8.2841393E+01 3.5941620E+01-8.2838966E+01 3.5937344E+01
+-8.2829063E+01 3.5932827E+01-8.2821999E+01 3.5921738E+01
+-8.2815262E+01 3.5925552E+01-8.2805138E+01 3.5927063E+01
+-8.2802902E+01 3.5930027E+01-8.2805984E+01 3.5937836E+01
+-8.2800568E+01 3.5944054E+01-8.2787598E+01 3.5952061E+01
+-8.2784676E+01 3.5963802E+01-8.2777885E+01 3.5966808E+01
+-8.2775040E+01 3.5971874E+01-8.2785698E+01 3.5977692E+01
+-8.2785271E+01 3.5987019E+01-8.2785843E+01 3.5988724E+01
+-8.2779533E+01 3.5992409E+01-8.2776001E+01 3.6000702E+01
+-8.2750198E+01 3.6005901E+01-8.2750801E+01 3.6008701E+01
+-8.2740196E+01 3.6012001E+01-8.2738998E+01 3.6014900E+01
+-8.2725197E+01 3.6018101E+01-8.2715797E+01 3.6022900E+01
+-8.2714996E+01 3.6028702E+01-8.2689003E+01 3.6038502E+01
+-8.2684402E+01 3.6045502E+01-8.2679398E+01 3.6048302E+01
+-8.2659302E+01 3.6056999E+01-8.2650307E+01 3.6057701E+01
+-8.2637306E+01 3.6065701E+01-8.2632401E+01 3.6065601E+01
+-8.2619400E+01 3.6056499E+01-8.2617401E+01 3.6054100E+01
+-8.2618301E+01 3.6046902E+01-8.2611305E+01 3.6044800E+01
+-8.2603020E+01 3.6039726E+01
+ 111 37567 89 79 44 27 2
+-8.0047302E+01 3.5920502E+01-8.0043404E+01 3.6010300E+01
+ 112 30556 90 85 24 49 10
+-8.1981888E+01 3.5911396E+01-8.1976379E+01 3.5915112E+01
+-8.1972443E+01 3.5914722E+01-8.1965179E+01 3.5920586E+01
+-8.1960564E+01 3.5921101E+01-8.1954674E+01 3.5926533E+01
+-8.1954651E+01 3.5931870E+01-8.1962593E+01 3.5937840E+01
+-8.1963120E+01 3.5941544E+01-8.1943840E+01 3.5959324E+01
+ 113 30628 67 90 24 34 14
+-8.2080597E+01 3.6102901E+01-8.2075905E+01 3.6095901E+01
+-8.2076508E+01 3.6085201E+01-8.2069199E+01 3.6076401E+01
+-8.2071198E+01 3.6069302E+01-8.2039001E+01 3.6007900E+01
+-8.2043198E+01 3.6005798E+01-8.2049103E+01 3.6008202E+01
+-8.2048508E+01 3.6001999E+01-8.2055519E+01 3.5998974E+01
+-8.2059128E+01 3.5991192E+01-8.2048431E+01 3.5963570E+01
+-8.2034355E+01 3.5941982E+01-8.1981888E+01 3.5911396E+01
+ 114 160 91 86 46 1 11
+-7.5995079E+01 3.5908951E+01-7.6012543E+01 3.5924721E+01
+-7.6013947E+01 3.5958328E+01-7.6022346E+01 3.5969532E+01
+-7.6062958E+01 3.5993340E+01-7.6146980E+01 3.5993340E+01
+-7.6218407E+01 3.5987736E+01-7.6287025E+01 3.5965332E+01
+-7.6315033E+01 3.5947124E+01-7.6348640E+01 3.5944324E+01
+-7.6360397E+01 3.5949467E+01
+ 115 29216 49 92 28 27 3
+-7.9532631E+01 3.6241299E+01-7.9539307E+01 3.6082699E+01
+-7.9542091E+01 3.5899727E+01
+ 116 29408 89 92 27 51 2
+-8.0047302E+01 3.5920502E+01-7.9542091E+01 3.5899727E+01
+ 117 29319 93 46 28 30 5
+-7.9249672E+01 3.5876720E+01-7.9258408E+01 3.5891644E+01
+-7.9257187E+01 3.5901283E+01-7.9264854E+01 3.5907345E+01
+-7.9257225E+01 3.6243732E+01
+ 118 39279 63 95 35 33 7
+-7.7698235E+01 3.6152775E+01-7.7704353E+01 3.6143993E+01
+-7.7707161E+01 3.6114700E+01-7.7743065E+01 3.6059303E+01
+-7.7771141E+01 3.6008751E+01-7.7778107E+01 3.5984497E+01
+-7.7828773E+01 3.5866989E+01
+ 119 31030 96 87 29 47 9
+-7.6761131E+01 3.5865410E+01-7.6750000E+01 3.5868881E+01
+-7.6739288E+01 3.5877861E+01-7.6733467E+01 3.5887012E+01
+-7.6724693E+01 3.5912235E+01-7.6713593E+01 3.5922581E+01
+-7.6701508E+01 3.5924442E+01-7.6694878E+01 3.5943478E+01
+-7.6693367E+01 3.5945099E+01
+ 120 38738 94 70 31 38 31
+-7.8906273E+01 3.5867786E+01-7.8831711E+01 3.5864517E+01
+-7.8806328E+01 3.5927715E+01-7.8759445E+01 3.5917881E+01
+-7.8752487E+01 3.5930920E+01-7.8742043E+01 3.5934055E+01
+-7.8730736E+01 3.5945412E+01-7.8713989E+01 3.5968250E+01
+-7.8699341E+01 3.6012947E+01-7.8707710E+01 3.6008301E+01
+-7.8706551E+01 3.6022629E+01-7.8708900E+01 3.6029129E+01
+-7.8713867E+01 3.6026814E+01-7.8721504E+01 3.6030685E+01
+-7.8724396E+01 3.6035027E+01-7.8727158E+01 3.6034157E+01
+-7.8727722E+01 3.6028965E+01-7.8734322E+01 3.6025116E+01
+-7.8736061E+01 3.6017445E+01-7.8758469E+01 3.6029575E+01
+-7.8752335E+01 3.6032360E+01-7.8750648E+01 3.6037189E+01
+-7.8746536E+01 3.6039783E+01-7.8749016E+01 3.6041767E+01
+-7.8753593E+01 3.6038311E+01-7.8757744E+01 3.6042149E+01
+-7.8752434E+01 3.6042057E+01-7.8749779E+01 3.6045448E+01
+-7.8749130E+01 3.6048225E+01-7.8755562E+01 3.6053078E+01
+-7.8749275E+01 3.6071098E+01
+ 121 34969 94 97 52 31 2
+-7.8906273E+01 3.5867786E+01-7.9016495E+01 3.5863003E+01
+ 122 38675 52 97 31 30 3
+-7.8951065E+01 3.6239021E+01-7.8990784E+01 3.6010002E+01
+-7.9016495E+01 3.5863003E+01
+ 123 34970 97 93 52 30 9
+-7.9016495E+01 3.5863003E+01-7.9083542E+01 3.5860783E+01
+-7.9121078E+01 3.5864475E+01-7.9122345E+01 3.5863098E+01
+-7.9192795E+01 3.5871281E+01-7.9192459E+01 3.5875130E+01
+-7.9206573E+01 3.5877254E+01-7.9207153E+01 3.5872730E+01
+-7.9249672E+01 3.5876720E+01
+ 124 38045 73 98 41 42 2
+-8.0692909E+01 3.6050964E+01-8.0708008E+01 3.5852615E+01
+ 125 29420 99 93 28 52 5
+-7.9542778E+01 3.5843235E+01-7.9237671E+01 3.5843979E+01
+-7.9237549E+01 3.5850624E+01-7.9251007E+01 3.5857262E+01
+-7.9249672E+01 3.5876720E+01
+ 126 29381 92 99 28 51 2
+-7.9542091E+01 3.5899727E+01-7.9542778E+01 3.5843235E+01
+ 127 30569 90 100 49 34 24
+-8.1981888E+01 3.5911396E+01-8.1979179E+01 3.5901466E+01
+-8.1980377E+01 3.5884796E+01-8.1989975E+01 3.5880096E+01
+-8.1991959E+01 3.5875801E+01-8.1999573E+01 3.5873882E+01
+-8.2003586E+01 3.5875542E+01-8.2004135E+01 3.5879707E+01
+-8.2007996E+01 3.5882767E+01-8.2013924E+01 3.5885124E+01
+-8.2023087E+01 3.5884628E+01-8.2028503E+01 3.5879147E+01
+-8.2029778E+01 3.5867512E+01-8.2036964E+01 3.5858734E+01
+-8.2048851E+01 3.5852840E+01-8.2071098E+01 3.5850395E+01
+-8.2073799E+01 3.5848244E+01-8.2089767E+01 3.5850880E+01
+-8.2091835E+01 3.5849125E+01-8.2098846E+01 3.5851810E+01
+-8.2101944E+01 3.5840672E+01-8.2117241E+01 3.5832512E+01
+-8.2120560E+01 3.5824963E+01-8.2133347E+01 3.5824329E+01
+ 128 45984 69 100 34 37 82
+-8.2416809E+01 3.6072731E+01-8.2399773E+01 3.6071407E+01
+-8.2402962E+01 3.6078377E+01-8.2398804E+01 3.6081802E+01
+-8.2377068E+01 3.6070484E+01-8.2370811E+01 3.6076359E+01
+-8.2358704E+01 3.6078671E+01-8.2356010E+01 3.6083332E+01
+-8.2351852E+01 3.6084263E+01-8.2345261E+01 3.6076252E+01
+-8.2337090E+01 3.6055145E+01-8.2338394E+01 3.6030186E+01
+-8.2323906E+01 3.6028931E+01-8.2320198E+01 3.6025349E+01
+-8.2313026E+01 3.6025726E+01-8.2311264E+01 3.6038647E+01
+-8.2299362E+01 3.6045219E+01-8.2299133E+01 3.6039837E+01
+-8.2290611E+01 3.6028957E+01-8.2280479E+01 3.6025364E+01
+-8.2267990E+01 3.6015995E+01-8.2272705E+01 3.6010666E+01
+-8.2274010E+01 3.6003578E+01-8.2262047E+01 3.5998436E+01
+-8.2252708E+01 3.5989223E+01-8.2249374E+01 3.5990616E+01
+-8.2252998E+01 3.5998634E+01-8.2252533E+01 3.6007942E+01
+-8.2237053E+01 3.6004509E+01-8.2237366E+01 3.6009193E+01
+-8.2232597E+01 3.6013264E+01-8.2227455E+01 3.6012772E+01
+-8.2214241E+01 3.6016788E+01-8.2205429E+01 3.6013832E+01
+-8.2198494E+01 3.6015415E+01-8.2194359E+01 3.6010712E+01
+-8.2193336E+01 3.6001671E+01-8.2195869E+01 3.6000183E+01
+-8.2200096E+01 3.6005657E+01-8.2203285E+01 3.6005836E+01
+-8.2203964E+01 3.6003548E+01-8.2197441E+01 3.5992123E+01
+-8.2192162E+01 3.5990749E+01-8.2191368E+01 3.5973518E+01
+-8.2194054E+01 3.5967018E+01-8.2186012E+01 3.5959652E+01
+-8.2187561E+01 3.5958164E+01-8.2192688E+01 3.5959454E+01
+-8.2197899E+01 3.5952293E+01-8.2185699E+01 3.5943062E+01
+-8.2183586E+01 3.5937313E+01-8.2177650E+01 3.5935753E+01
+-8.2169792E+01 3.5928658E+01-8.2167175E+01 3.5934677E+01
+-8.2160805E+01 3.5930576E+01-8.2155067E+01 3.5933781E+01
+-8.2145752E+01 3.5931969E+01-8.2153069E+01 3.5928558E+01
+-8.2150757E+01 3.5924644E+01-8.2155182E+01 3.5921230E+01
+-8.2155273E+01 3.5915047E+01-8.2150543E+01 3.5916492E+01
+-8.2148376E+01 3.5912186E+01-8.2145027E+01 3.5913857E+01
+-8.2143372E+01 3.5910603E+01-8.2143646E+01 3.5905132E+01
+-8.2145645E+01 3.5904259E+01-8.2147423E+01 3.5906418E+01
+-8.2147034E+01 3.5897575E+01-8.2144867E+01 3.5896729E+01
+-8.2150383E+01 3.5892288E+01-8.2146446E+01 3.5887524E+01
+-8.2146461E+01 3.5863529E+01-8.2141541E+01 3.5857689E+01
+-8.2142929E+01 3.5848461E+01-8.2138992E+01 3.5845757E+01
+-8.2142281E+01 3.5841705E+01-8.2144226E+01 3.5843719E+01
+-8.2150269E+01 3.5841320E+01-8.2144035E+01 3.5829388E+01
+-8.2144775E+01 3.5824280E+01-8.2133347E+01 3.5824329E+01
+ 129 31159 80 101 39 35 6
+-7.7403008E+01 3.6004776E+01-7.7409431E+01 3.5998547E+01
+-7.7342773E+01 3.5905205E+01-7.7344727E+01 3.5875401E+01
+-7.7349930E+01 3.5867100E+01-7.7350914E+01 3.5819057E+01
+ 130 44977 82 102 37 40 25
+-8.2505531E+01 3.5977573E+01-8.2500999E+01 3.5965870E+01
+-8.2496391E+01 3.5962570E+01-8.2496719E+01 3.5957146E+01
+-8.2485237E+01 3.5953526E+01-8.2479996E+01 3.5949142E+01
+-8.2498627E+01 3.5929829E+01-8.2497726E+01 3.5925175E+01
+-8.2489922E+01 3.5919594E+01-8.2494698E+01 3.5909306E+01
+-8.2486275E+01 3.5906963E+01-8.2475060E+01 3.5909286E+01
+-8.2463707E+01 3.5899574E+01-8.2453400E+01 3.5899601E+01
+-8.2448555E+01 3.5896751E+01-8.2440163E+01 3.5879742E+01
+-8.2432678E+01 3.5876888E+01-8.2423836E+01 3.5869457E+01
+-8.2425529E+01 3.5861187E+01-8.2417870E+01 3.5859535E+01
+-8.2419624E+01 3.5841400E+01-8.2416306E+01 3.5828995E+01
+-8.2412239E+01 3.5826725E+01-8.2414032E+01 3.5819603E+01
+-8.2408882E+01 3.5817947E+01
+ 131 40526 57 103 33 25 3
+-7.8006844E+01 3.6202530E+01-7.8172638E+01 3.5955891E+01
+-7.8255203E+01 3.5817451E+01
+ 132 40377 78 103 25 38 18
+-7.8546776E+01 3.6021656E+01-7.8432770E+01 3.5980839E+01
+-7.8394737E+01 3.5936638E+01-7.8353729E+01 3.5930855E+01
+-7.8350616E+01 3.5909340E+01-7.8336243E+01 3.5905796E+01
+-7.8330002E+01 3.5897079E+01-7.8318260E+01 3.5894402E+01
+-7.8313934E+01 3.5897125E+01-7.8307976E+01 3.5896393E+01
+-7.8295486E+01 3.5881081E+01-7.8291550E+01 3.5880096E+01
+-7.8290344E+01 3.5876369E+01-7.8282829E+01 3.5871826E+01
+-7.8273148E+01 3.5857437E+01-7.8268967E+01 3.5842602E+01
+-7.8255402E+01 3.5827904E+01-7.8255203E+01 3.5817451E+01
+ 133 31128 68 96 29 39 105
+-7.7327950E+01 3.6074780E+01-7.7327667E+01 3.6068695E+01
+-7.7321663E+01 3.6056496E+01-7.7291054E+01 3.6043655E+01
+-7.7273582E+01 3.6032848E+01-7.7231171E+01 3.6015450E+01
+-7.7216713E+01 3.6014469E+01-7.7207047E+01 3.6006962E+01
+-7.7213638E+01 3.5992355E+01-7.7210846E+01 3.5990479E+01
+-7.7205246E+01 3.5993252E+01-7.7196770E+01 3.5992359E+01
+-7.7193047E+01 3.5984993E+01-7.7196854E+01 3.5982563E+01
+-7.7196266E+01 3.5979588E+01-7.7191139E+01 3.5973339E+01
+-7.7196823E+01 3.5965900E+01-7.7191360E+01 3.5960476E+01
+-7.7196701E+01 3.5962925E+01-7.7198090E+01 3.5961781E+01
+-7.7189217E+01 3.5957615E+01-7.7199631E+01 3.5956879E+01
+-7.7194763E+01 3.5949673E+01-7.7201263E+01 3.5950768E+01
+-7.7202591E+01 3.5947334E+01-7.7198395E+01 3.5938431E+01
+-7.7187897E+01 3.5931454E+01-7.7171989E+01 3.5929092E+01
+-7.7163605E+01 3.5937515E+01-7.7141403E+01 3.5933800E+01
+-7.7131714E+01 3.5940502E+01-7.7125000E+01 3.5926239E+01
+-7.7121323E+01 3.5925484E+01-7.7115631E+01 3.5928921E+01
+-7.7110962E+01 3.5927387E+01-7.7103737E+01 3.5933025E+01
+-7.7093399E+01 3.5924488E+01-7.7087212E+01 3.5931862E+01
+-7.7082062E+01 3.5931835E+01-7.7081383E+01 3.5937195E+01
+-7.7074097E+01 3.5934196E+01-7.7067566E+01 3.5936462E+01
+-7.7070442E+01 3.5943722E+01-7.7059883E+01 3.5938591E+01
+-7.7055267E+01 3.5944611E+01-7.7044006E+01 3.5942989E+01
+-7.7039452E+01 3.5930851E+01-7.7028023E+01 3.5929363E+01
+-7.7032303E+01 3.5917805E+01-7.7027802E+01 3.5917595E+01
+-7.7027130E+01 3.5909885E+01-7.7030907E+01 3.5905029E+01
+-7.7026062E+01 3.5903194E+01-7.7025558E+01 3.5894382E+01
+-7.7022499E+01 3.5891014E+01-7.7030121E+01 3.5893105E+01
+-7.7037804E+01 3.5890610E+01-7.7031471E+01 3.5881226E+01
+-7.7039864E+01 3.5874664E+01-7.7044212E+01 3.5875710E+01
+-7.7045853E+01 3.5874004E+01-7.7040565E+01 3.5867893E+01
+-7.7045006E+01 3.5861916E+01-7.7036377E+01 3.5857613E+01
+-7.7029411E+01 3.5857384E+01-7.7015938E+01 3.5862232E+01
+-7.7005226E+01 3.5858269E+01-7.6990570E+01 3.5866646E+01
+-7.6988014E+01 3.5876362E+01-7.6985146E+01 3.5876839E+01
+-7.6980705E+01 3.5872486E+01-7.6978905E+01 3.5876339E+01
+-7.6969147E+01 3.5882362E+01-7.6958656E+01 3.5883785E+01
+-7.6957809E+01 3.5886833E+01-7.6947823E+01 3.5893398E+01
+-7.6947853E+01 3.5896954E+01-7.6941383E+01 3.5901184E+01
+-7.6922615E+01 3.5897865E+01-7.6916794E+01 3.5893173E+01
+-7.6912125E+01 3.5881950E+01-7.6905067E+01 3.5876823E+01
+-7.6902710E+01 3.5868008E+01-7.6893600E+01 3.5863884E+01
+-7.6900917E+01 3.5857224E+01-7.6897659E+01 3.5849667E+01
+-7.6904045E+01 3.5838154E+01-7.6894577E+01 3.5830479E+01
+-7.6904617E+01 3.5823845E+01-7.6893547E+01 3.5818233E+01
+-7.6897987E+01 3.5815514E+01-7.6897614E+01 3.5813519E+01
+-7.6883705E+01 3.5811520E+01-7.6875641E+01 3.5813534E+01
+-7.6859505E+01 3.5825623E+01-7.6834373E+01 3.5850815E+01
+-7.6832069E+01 3.5857960E+01-7.6836914E+01 3.5878632E+01
+-7.6830559E+01 3.5885818E+01-7.6822029E+01 3.5886902E+01
+-7.6806557E+01 3.5883671E+01-7.6791801E+01 3.5868790E+01
+-7.6781197E+01 3.5863728E+01-7.6774002E+01 3.5862446E+01
+-7.6761131E+01 3.5865410E+01
+ 134 162 104 104 50 1 31
+-7.5621239E+01 3.5802872E+01-7.5618500E+01 3.5804699E+01
+-7.5619408E+01 3.5810791E+01-7.5613625E+01 3.5815659E+01
+-7.5618797E+01 3.5832718E+01-7.5614235E+01 3.5853119E+01
+-7.5627937E+01 3.5882053E+01-7.5645294E+01 3.5904583E+01
+-7.5645599E+01 3.5909763E+01-7.5671486E+01 3.5927425E+01
+-7.5705872E+01 3.5939213E+01-7.5718994E+01 3.5939606E+01
+-7.5727524E+01 3.5936256E+01-7.5724167E+01 3.5924683E+01
+-7.5709251E+01 3.5918896E+01-7.5701324E+01 3.5913113E+01
+-7.5697067E+01 3.5909454E+01-7.5697670E+01 3.5901844E+01
+-7.5685188E+01 3.5890881E+01-7.5682449E+01 3.5883266E+01
+-7.5675133E+01 3.5881744E+01-7.5668747E+01 3.5877174E+01
+-7.5661125E+01 3.5860123E+01-7.5663872E+01 3.5850380E+01
+-7.5661125E+01 3.5822365E+01-7.5652306E+01 3.5821751E+01
+-7.5641945E+01 3.5815968E+01-7.5634941E+01 3.5820232E+01
+-7.5630676E+01 3.5818405E+01-7.5629463E+01 3.5811096E+01
+-7.5621239E+01 3.5802872E+01
+ 135 29846 81 105 43 36 13
+-8.1328575E+01 3.5996422E+01-8.1343147E+01 3.5923031E+01
+-8.1333710E+01 3.5879650E+01-8.1343979E+01 3.5823833E+01
+-8.1342552E+01 3.5822227E+01-8.1340088E+01 3.5824024E+01
+-8.1337593E+01 3.5817780E+01-8.1340172E+01 3.5815929E+01
+-8.1335938E+01 3.5814384E+01-8.1338112E+01 3.5812500E+01
+-8.1335220E+01 3.5803650E+01-8.1332092E+01 3.5802540E+01
+-8.1334450E+01 3.5796329E+01
+ 136 31298 106 88 1 40 32
+-8.2961777E+01 3.5790955E+01-8.2961853E+01 3.5800392E+01
+-8.2952835E+01 3.5814816E+01-8.2948151E+01 3.5817703E+01
+-8.2944427E+01 3.5825394E+01-8.2936089E+01 3.5825459E+01
+-8.2933311E+01 3.5830364E+01-8.2934128E+01 3.5836533E+01
+-8.2916405E+01 3.5841503E+01-8.2921112E+01 3.5850971E+01
+-8.2918640E+01 3.5859047E+01-8.2921577E+01 3.5863224E+01
+-8.2920746E+01 3.5868374E+01-8.2906502E+01 3.5870209E+01
+-8.2900543E+01 3.5873234E+01-8.2896370E+01 3.5879028E+01
+-8.2898109E+01 3.5881176E+01-8.2903694E+01 3.5880276E+01
+-8.2906548E+01 3.5883591E+01-8.2901237E+01 3.5892857E+01
+-8.2908554E+01 3.5904972E+01-8.2908356E+01 3.5910999E+01
+-8.2914635E+01 3.5915051E+01-8.2911835E+01 3.5916653E+01
+-8.2913475E+01 3.5924011E+01-8.2920525E+01 3.5927124E+01
+-8.2914513E+01 3.5929585E+01-8.2906143E+01 3.5926186E+01
+-8.2902229E+01 3.5926716E+01-8.2899139E+01 3.5930279E+01
+-8.2901848E+01 3.5937611E+01-8.2898643E+01 3.5945000E+01
+ 137 30026 75 107 42 43 9
+-8.1029350E+01 3.6045567E+01-8.1003792E+01 3.5991646E+01
+-8.1005157E+01 3.5959244E+01-8.1042137E+01 3.5857449E+01
+-8.1060760E+01 3.5834297E+01-8.1065254E+01 3.5823692E+01
+-8.1078583E+01 3.5811096E+01-8.1079590E+01 3.5801956E+01
+-8.1112083E+01 3.5779045E+01
+ 138 29981 107 105 56 43 22
+-8.1112083E+01 3.5779045E+01-8.1128616E+01 3.5789253E+01
+-8.1131004E+01 3.5803108E+01-8.1141281E+01 3.5812031E+01
+-8.1141731E+01 3.5827263E+01-8.1144157E+01 3.5828930E+01
+-8.1154594E+01 3.5828297E+01-8.1160507E+01 3.5824955E+01
+-8.1168541E+01 3.5825462E+01-8.1195000E+01 3.5821049E+01
+-8.1203339E+01 3.5823429E+01-8.1216385E+01 3.5817142E+01
+-8.1224762E+01 3.5809910E+01-8.1249840E+01 3.5815552E+01
+-8.1254303E+01 3.5808666E+01-8.1267471E+01 3.5804363E+01
+-8.1280312E+01 3.5806004E+01-8.1289192E+01 3.5800259E+01
+-8.1298264E+01 3.5798061E+01-8.1307159E+01 3.5803249E+01
+-8.1316101E+01 3.5796726E+01-8.1334450E+01 3.5796329E+01
+ 139 160 56 55 32 1 29
+-7.5787750E+01 3.6228706E+01-7.5787483E+01 3.6228245E+01
+-7.5771729E+01 3.6208553E+01-7.5741966E+01 3.6085976E+01
+-7.5741966E+01 3.6054325E+01-7.5727974E+01 3.6001862E+01
+-7.5713112E+01 3.6000984E+01-7.5696495E+01 3.5993114E+01
+-7.5670265E+01 3.5972130E+01-7.5649277E+01 3.5966007E+01
+-7.5633537E+01 3.5949390E+01-7.5623047E+01 3.5931904E+01
+-7.5609924E+01 3.5875938E+01-7.5601181E+01 3.5868942E+01
+-7.5595940E+01 3.5851456E+01-7.5578445E+01 3.5834843E+01
+-7.5576698E+01 3.5822601E+01-7.5570580E+01 3.5807735E+01
+-7.5563583E+01 3.5797241E+01-7.5551346E+01 3.5793743E+01
+-7.5542603E+01 3.5773632E+01-7.5537354E+01 3.5778881E+01
+-7.5534729E+01 3.5793743E+01-7.5553970E+01 3.5825226E+01
+-7.5582825E+01 3.5884686E+01-7.5631790E+01 3.5973003E+01
+-7.5711357E+01 3.6099796E+01-7.5736717E+01 3.6147888E+01
+-7.5773750E+01 3.6231594E+01
+ 140 29879 108 105 36 56 7
+-8.1364250E+01 3.5767735E+01-8.1358582E+01 3.5766636E+01
+-8.1353874E+01 3.5768955E+01-8.1352982E+01 3.5773998E+01
+-8.1356079E+01 3.5779743E+01-8.1347244E+01 3.5793270E+01
+-8.1334450E+01 3.5796329E+01
+ 141 30564 108 84 45 36 39
+-8.1364250E+01 3.5767735E+01-8.1371384E+01 3.5766254E+01
+-8.1377975E+01 3.5757164E+01-8.1391495E+01 3.5759243E+01
+-8.1399277E+01 3.5758270E+01-8.1408623E+01 3.5765141E+01
+-8.1424713E+01 3.5771168E+01-8.1442001E+01 3.5773670E+01
+-8.1446541E+01 3.5785080E+01-8.1490456E+01 3.5780415E+01
+-8.1516342E+01 3.5780727E+01-8.1556145E+01 3.5777203E+01
+-8.1600891E+01 3.5824905E+01-8.1610420E+01 3.5819389E+01
+-8.1629913E+01 3.5830208E+01-8.1626198E+01 3.5833397E+01
+-8.1632225E+01 3.5835724E+01-8.1639336E+01 3.5848282E+01
+-8.1710335E+01 3.5875000E+01-8.1717010E+01 3.5883049E+01
+-8.1728851E+01 3.5890621E+01-8.1735641E+01 3.5903141E+01
+-8.1744843E+01 3.5908680E+01-8.1745857E+01 3.5916138E+01
+-8.1751350E+01 3.5924164E+01-8.1757034E+01 3.5925377E+01
+-8.1759041E+01 3.5928158E+01-8.1763008E+01 3.5925510E+01
+-8.1767624E+01 3.5928833E+01-8.1777451E+01 3.5927044E+01
+-8.1775955E+01 3.5933609E+01-8.1779877E+01 3.5939571E+01
+-8.1776588E+01 3.5942738E+01-8.1777985E+01 3.5947235E+01
+-8.1788483E+01 3.5947453E+01-8.1794815E+01 3.5951073E+01
+-8.1797066E+01 3.5948967E+01-8.1809135E+01 3.5958103E+01
+-8.1807289E+01 3.5961929E+01
+ 142 37392 83 109 44 41 41
+-8.0394524E+01 3.5972614E+01-8.0390701E+01 3.5967274E+01
+-8.0378853E+01 3.5962875E+01-8.0375000E+01 3.5955452E+01
+-8.0375763E+01 3.5940388E+01-8.0368576E+01 3.5928082E+01
+-8.0375305E+01 3.5912270E+01-8.0365646E+01 3.5893330E+01
+-8.0373093E+01 3.5884399E+01-8.0391861E+01 3.5892277E+01
+-8.0407913E+01 3.5891376E+01-8.0416656E+01 3.5881798E+01
+-8.0412277E+01 3.5877045E+01-8.0390160E+01 3.5868160E+01
+-8.0385796E+01 3.5854076E+01-8.0388580E+01 3.5845581E+01
+-8.0391708E+01 3.5842529E+01-8.0398903E+01 3.5841312E+01
+-8.0415802E+01 3.5851936E+01-8.0422485E+01 3.5852280E+01
+-8.0425789E+01 3.5848309E+01-8.0427666E+01 3.5833759E+01
+-8.0432922E+01 3.5828014E+01-8.0435837E+01 3.5828083E+01
+-8.0446159E+01 3.5836468E+01-8.0455482E+01 3.5827286E+01
+-8.0464310E+01 3.5827400E+01-8.0476128E+01 3.5843475E+01
+-8.0481888E+01 3.5841011E+01-8.0488075E+01 3.5833149E+01
+-8.0486748E+01 3.5830875E+01-8.0479218E+01 3.5831062E+01
+-8.0475174E+01 3.5828056E+01-8.0465843E+01 3.5809490E+01
+-8.0464844E+01 3.5802971E+01-8.0474083E+01 3.5797928E+01
+-8.0476913E+01 3.5789051E+01-8.0451546E+01 3.5767979E+01
+-8.0452942E+01 3.5758121E+01-8.0459267E+01 3.5749378E+01
+-8.0459129E+01 3.5742672E+01
+ 143 37938 109 98 54 41 47
+-8.0459129E+01 3.5742672E+01-8.0462418E+01 3.5750729E+01
+-8.0468910E+01 3.5757252E+01-8.0471863E+01 3.5768059E+01
+-8.0478844E+01 3.5774860E+01-8.0484940E+01 3.5775635E+01
+-8.0488045E+01 3.5766109E+01-8.0492439E+01 3.5778885E+01
+-8.0496017E+01 3.5782204E+01-8.0501938E+01 3.5782959E+01
+-8.0508659E+01 3.5774765E+01-8.0520882E+01 3.5784409E+01
+-8.0527992E+01 3.5783566E+01-8.0532791E+01 3.5785309E+01
+-8.0533859E+01 3.5791058E+01-8.0537514E+01 3.5790257E+01
+-8.0543755E+01 3.5792774E+01-8.0547012E+01 3.5798180E+01
+-8.0555138E+01 3.5800793E+01-8.0570602E+01 3.5816341E+01
+-8.0586769E+01 3.5822979E+01-8.0590141E+01 3.5821285E+01
+-8.0587585E+01 3.5819134E+01-8.0591827E+01 3.5817642E+01
+-8.0594276E+01 3.5827332E+01-8.0599594E+01 3.5827099E+01
+-8.0601784E+01 3.5823479E+01-8.0603363E+01 3.5826160E+01
+-8.0604286E+01 3.5823666E+01-8.0610161E+01 3.5823475E+01
+-8.0612610E+01 3.5825626E+01-8.0611397E+01 3.5831242E+01
+-8.0623390E+01 3.5839134E+01-8.0631538E+01 3.5838772E+01
+-8.0631844E+01 3.5845505E+01-8.0642586E+01 3.5844044E+01
+-8.0650291E+01 3.5846268E+01-8.0660866E+01 3.5844578E+01
+-8.0671890E+01 3.5846500E+01-8.0673096E+01 3.5849640E+01
+-8.0669128E+01 3.5856163E+01-8.0682884E+01 3.5857723E+01
+-8.0691605E+01 3.5863270E+01-8.0693436E+01 3.5853783E+01
+-8.0696785E+01 3.5854473E+01-8.0700722E+01 3.5850349E+01
+-8.0708008E+01 3.5852615E+01
+ 144 39314 101 110 39 55 16
+-7.7350914E+01 3.5819057E+01-7.7255531E+01 3.5786087E+01
+-7.7255783E+01 3.5783043E+01-7.7265289E+01 3.5774376E+01
+-7.7260490E+01 3.5765377E+01-7.7247086E+01 3.5760540E+01
+-7.7238831E+01 3.5761803E+01-7.7223473E+01 3.5758629E+01
+-7.7215324E+01 3.5759727E+01-7.7201477E+01 3.5751900E+01
+-7.7203873E+01 3.5748886E+01-7.7202667E+01 3.5746368E+01
+-7.7192558E+01 3.5746780E+01-7.7188850E+01 3.5742432E+01
+-7.7180679E+01 3.5740646E+01-7.7174057E+01 3.5732796E+01
+ 145 39500 111 95 33 53 10
+-7.8192352E+01 3.5730289E+01-7.8181198E+01 3.5738277E+01
+-7.8147491E+01 3.5745548E+01-7.8006973E+01 3.5799332E+01
+-7.7897942E+01 3.5843872E+01-7.7883347E+01 3.5846069E+01
+-7.7874435E+01 3.5849777E+01-7.7853622E+01 3.5843864E+01
+-7.7845116E+01 3.5837334E+01-7.7828773E+01 3.5866989E+01
+ 146 40455 103 111 33 58 18
+-7.8255203E+01 3.5817451E+01-7.8257187E+01 3.5813076E+01
+-7.8251869E+01 3.5810806E+01-7.8249512E+01 3.5794971E+01
+-7.8247803E+01 3.5792274E+01-7.8244179E+01 3.5792160E+01
+-7.8250755E+01 3.5772957E+01-7.8238777E+01 3.5768318E+01
+-7.8233711E+01 3.5752094E+01-7.8226295E+01 3.5750408E+01
+-7.8222198E+01 3.5754341E+01-7.8217995E+01 3.5754112E+01
+-7.8215645E+01 3.5735958E+01-7.8209618E+01 3.5730560E+01
+-7.8206383E+01 3.5730583E+01-7.8207085E+01 3.5728523E+01
+-7.8194321E+01 3.5728344E+01-7.8192352E+01 3.5730289E+01
+ 147 31296 112 106 1 59 32
+-8.3255615E+01 3.5714882E+01-8.3251373E+01 3.5719818E+01
+-8.3243629E+01 3.5722435E+01-8.3240799E+01 3.5726665E+01
+-8.3220116E+01 3.5726505E+01-8.3214630E+01 3.5724335E+01
+-8.3203880E+01 3.5726456E+01-8.3198395E+01 3.5725395E+01
+-8.3185814E+01 3.5729794E+01-8.3177628E+01 3.5743816E+01
+-8.3170303E+01 3.5746014E+01-8.3164894E+01 3.5754520E+01
+-8.3165039E+01 3.5759869E+01-8.3159332E+01 3.5764797E+01
+-8.3136574E+01 3.5765156E+01-8.3127838E+01 3.5767998E+01
+-8.3120316E+01 3.5766136E+01-8.3117516E+01 3.5769810E+01
+-8.3097321E+01 3.5775967E+01-8.3078590E+01 3.5789459E+01
+-8.3063896E+01 3.5786545E+01-8.3052811E+01 3.5789448E+01
+-8.3044243E+01 3.5785248E+01-8.3036346E+01 3.5787308E+01
+-8.3020844E+01 3.5780308E+01-8.3016335E+01 3.5781868E+01
+-8.3006203E+01 3.5778305E+01-8.3001610E+01 3.5773651E+01
+-8.2995934E+01 3.5773029E+01-8.2984100E+01 3.5777912E+01
+-8.2969788E+01 3.5789562E+01-8.2961777E+01 3.5790955E+01
+ 148 32411 114 102 57 37 23
+-8.2275551E+01 3.5704308E+01-8.2275993E+01 3.5714108E+01
+-8.2285339E+01 3.5725739E+01-8.2291435E+01 3.5729843E+01
+-8.2313164E+01 3.5733383E+01-8.2322365E+01 3.5740265E+01
+-8.2326904E+01 3.5747204E+01-8.2335121E+01 3.5748592E+01
+-8.2337883E+01 3.5767895E+01-8.2343842E+01 3.5775356E+01
+-8.2346626E+01 3.5786625E+01-8.2338455E+01 3.5796051E+01
+-8.2339188E+01 3.5800873E+01-8.2346863E+01 3.5805737E+01
+-8.2348862E+01 3.5811180E+01-8.2358971E+01 3.5816849E+01
+-8.2362144E+01 3.5821236E+01-8.2366241E+01 3.5821632E+01
+-8.2373779E+01 3.5817692E+01-8.2381790E+01 3.5823967E+01
+-8.2399651E+01 3.5817959E+01-8.2403946E+01 3.5819328E+01
+-8.2408882E+01 3.5817947E+01
+ 149 30899 113 115 61 47 3
+-7.6638641E+01 3.5705070E+01-7.6829910E+01 3.5705334E+01
+-7.6839928E+01 3.5702335E+01
+ 150 31103 115 96 39 47 28
+-7.6839928E+01 3.5702335E+01-7.6841972E+01 3.5708218E+01
+-7.6839592E+01 3.5716812E+01-7.6827751E+01 3.5719799E+01
+-7.6833511E+01 3.5726280E+01-7.6831284E+01 3.5730633E+01
+-7.6832832E+01 3.5736275E+01-7.6827217E+01 3.5739323E+01
+-7.6825981E+01 3.5744778E+01-7.6817787E+01 3.5747616E+01
+-7.6820984E+01 3.5754227E+01-7.6816856E+01 3.5760502E+01
+-7.6809013E+01 3.5763638E+01-7.6803627E+01 3.5773663E+01
+-7.6804153E+01 3.5783558E+01-7.6792885E+01 3.5788979E+01
+-7.6794006E+01 3.5795460E+01-7.6803703E+01 3.5806381E+01
+-7.6796562E+01 3.5816936E+01-7.6782906E+01 3.5824352E+01
+-7.6785065E+01 3.5832733E+01-7.6789673E+01 3.5837883E+01
+-7.6779007E+01 3.5856651E+01-7.6775330E+01 3.5859013E+01
+-7.6772141E+01 3.5858139E+01-7.6771919E+01 3.5861000E+01
+-7.6761490E+01 3.5862877E+01-7.6761131E+01 3.5865410E+01
+ 151 30570 100 114 49 37 20
+-8.2133347E+01 3.5824329E+01-8.2141403E+01 3.5812828E+01
+-8.2150101E+01 3.5809364E+01-8.2147774E+01 3.5804066E+01
+-8.2158730E+01 3.5801029E+01-8.2167976E+01 3.5789173E+01
+-8.2166969E+01 3.5784519E+01-8.2158440E+01 3.5779240E+01
+-8.2170509E+01 3.5763084E+01-8.2169838E+01 3.5760799E+01
+-8.2184547E+01 3.5753204E+01-8.2193474E+01 3.5735191E+01
+-8.2198036E+01 3.5735943E+01-8.2213722E+01 3.5724140E+01
+-8.2230064E+01 3.5717560E+01-8.2242760E+01 3.5712746E+01
+-8.2244843E+01 3.5708767E+01-8.2252296E+01 3.5706280E+01
+-8.2258133E+01 3.5698692E+01-8.2275551E+01 3.5704308E+01
+ 152 35487 116 86 47 46 9
+-7.6395630E+01 3.5697304E+01-7.6404037E+01 3.5788574E+01
+-7.6353790E+01 3.5861168E+01-7.6360275E+01 3.5875294E+01
+-7.6369774E+01 3.5883183E+01-7.6380119E+01 3.5914654E+01
+-7.6368111E+01 3.5929577E+01-7.6365845E+01 3.5943920E+01
+-7.6360397E+01 3.5949467E+01
+ 153 30911 116 113 62 47 3
+-7.6395630E+01 3.5697304E+01-7.6546448E+01 3.5704868E+01
+-7.6638641E+01 3.5705070E+01
+ 154 31295 112 117 59 1 4
+-8.3255615E+01 3.5714882E+01-8.3250824E+01 3.5709251E+01
+-8.3257683E+01 3.5705311E+01-8.3254356E+01 3.5695713E+01
+ 155 32410 102 118 57 40 59
+-8.2408882E+01 3.5817947E+01-8.2417336E+01 3.5813377E+01
+-8.2427208E+01 3.5813843E+01-8.2435860E+01 3.5808441E+01
+-8.2447113E+01 3.5810356E+01-8.2454216E+01 3.5807205E+01
+-8.2463531E+01 3.5809620E+01-8.2465202E+01 3.5801723E+01
+-8.2475792E+01 3.5798195E+01-8.2488457E+01 3.5801392E+01
+-8.2495552E+01 3.5799343E+01-8.2499168E+01 3.5801476E+01
+-8.2515739E+01 3.5802803E+01-8.2520752E+01 3.5798786E+01
+-8.2531471E+01 3.5795929E+01-8.2535950E+01 3.5790901E+01
+-8.2539680E+01 3.5791702E+01-8.2638458E+01 3.5750000E+01
+-8.2668205E+01 3.5737244E+01-8.2668495E+01 3.5734680E+01
+-8.2677788E+01 3.5734520E+01-8.2669617E+01 3.5730190E+01
+-8.2670097E+01 3.5725636E+01-8.2685760E+01 3.5726967E+01
+-8.2692810E+01 3.5734016E+01-8.2696632E+01 3.5734596E+01
+-8.2712410E+01 3.5732662E+01-8.2710213E+01 3.5728428E+01
+-8.2713783E+01 3.5726730E+01-8.2709122E+01 3.5725544E+01
+-8.2714142E+01 3.5717369E+01-8.2720901E+01 3.5715443E+01
+-8.2726685E+01 3.5717068E+01-8.2731239E+01 3.5722195E+01
+-8.2732704E+01 3.5718140E+01-8.2736656E+01 3.5716030E+01
+-8.2733124E+01 3.5714203E+01-8.2737213E+01 3.5711777E+01
+-8.2745270E+01 3.5714428E+01-8.2746201E+01 3.5712254E+01
+-8.2751785E+01 3.5710812E+01-8.2750359E+01 3.5706413E+01
+-8.2764252E+01 3.5699547E+01-8.2769646E+01 3.5698132E+01
+-8.2774879E+01 3.5699959E+01-8.2788750E+01 3.5695663E+01
+-8.2793030E+01 3.5696453E+01-8.2797958E+01 3.5689095E+01
+-8.2804932E+01 3.5686020E+01-8.2816010E+01 3.5689117E+01
+-8.2823921E+01 3.5688229E+01-8.2838837E+01 3.5693260E+01
+-8.2842812E+01 3.5699520E+01-8.2848701E+01 3.5701645E+01
+-8.2854347E+01 3.5698933E+01-8.2856979E+01 3.5693295E+01
+-8.2871162E+01 3.5688816E+01-8.2874794E+01 3.5683311E+01
+-8.2884171E+01 3.5678082E+01
+ 156 31923 118 106 59 40 23
+-8.2884171E+01 3.5678082E+01-8.2901329E+01 3.5684864E+01
+-8.2898293E+01 3.5690609E+01-8.2900726E+01 3.5695549E+01
+-8.2898834E+01 3.5703564E+01-8.2910530E+01 3.5716133E+01
+-8.2906776E+01 3.5720085E+01-8.2907738E+01 3.5727482E+01
+-8.2915642E+01 3.5737476E+01-8.2917763E+01 3.5744823E+01
+-8.2923317E+01 3.5746704E+01-8.2936378E+01 3.5744781E+01
+-8.2948013E+01 3.5738956E+01-8.2953110E+01 3.5742676E+01
+-8.2953461E+01 3.5745724E+01-8.2957352E+01 3.5746998E+01
+-8.2955322E+01 3.5750401E+01-8.2956863E+01 3.5757473E+01
+-8.2952728E+01 3.5759056E+01-8.2950371E+01 3.5765926E+01
+-8.2952408E+01 3.5770729E+01-8.2949989E+01 3.5774284E+01
+-8.2961777E+01 3.5790955E+01
+ 157 39254 119 101 35 55 12
+-7.7661613E+01 3.5677162E+01-7.7538681E+01 3.5750000E+01
+-7.7516609E+01 3.5760799E+01-7.7472626E+01 3.5800907E+01
+-7.7452133E+01 3.5800018E+01-7.7445595E+01 3.5808605E+01
+-7.7424889E+01 3.5805283E+01-7.7417549E+01 3.5811325E+01
+-7.7412262E+01 3.5825241E+01-7.7397118E+01 3.5825146E+01
+-7.7390480E+01 3.5832745E+01-7.7350914E+01 3.5819057E+01
+ 158 39406 95 119 35 53 8
+-7.7828773E+01 3.5866989E+01-7.7822823E+01 3.5861828E+01
+-7.7806992E+01 3.5857185E+01-7.7751869E+01 3.5827705E+01
+-7.7748901E+01 3.5820850E+01-7.7750397E+01 3.5817242E+01
+-7.7720345E+01 3.5730042E+01-7.7661613E+01 3.5677162E+01
+ 159 34131 120 91 46 48 8
+-7.6027817E+01 3.5668945E+01-7.6020782E+01 3.5685883E+01
+-7.6027626E+01 3.5721191E+01-7.6019669E+01 3.5752613E+01
+-7.6022758E+01 3.5810394E+01-7.6018059E+01 3.5865162E+01
+-7.6009544E+01 3.5894287E+01-7.5995079E+01 3.5908951E+01
+ 160 30934 115 110 61 39 7
+-7.6839928E+01 3.5702335E+01-7.6986076E+01 3.5658325E+01
+-7.7066734E+01 3.5693481E+01-7.7156761E+01 3.5736725E+01
+-7.7163918E+01 3.5739246E+01-7.7171753E+01 3.5736298E+01
+-7.7174057E+01 3.5732796E+01
+ 161 39526 119 121 55 53 2
+-7.7661613E+01 3.5677162E+01-7.7700806E+01 3.5652100E+01
+ 162 34363 120 116 62 46 57
+-7.6027817E+01 3.5668945E+01-7.6031227E+01 3.5663055E+01
+-7.6035637E+01 3.5661858E+01-7.6040894E+01 3.5662575E+01
+-7.6059784E+01 3.5674961E+01-7.6075104E+01 3.5671413E+01
+-7.6086868E+01 3.5674644E+01-7.6095566E+01 3.5669147E+01
+-7.6099983E+01 3.5671265E+01-7.6104851E+01 3.5678280E+01
+-7.6119453E+01 3.5679295E+01-7.6120834E+01 3.5682724E+01
+-7.6117920E+01 3.5691208E+01-7.6131210E+01 3.5691093E+01
+-7.6141762E+01 3.5702576E+01-7.6163834E+01 3.5695747E+01
+-7.6170120E+01 3.5698353E+01-7.6173325E+01 3.5696011E+01
+-7.6167511E+01 3.5690830E+01-7.6175819E+01 3.5690769E+01
+-7.6176834E+01 3.5686256E+01-7.6172501E+01 3.5682178E+01
+-7.6175514E+01 3.5677734E+01-7.6170166E+01 3.5672047E+01
+-7.6175797E+01 3.5672565E+01-7.6176323E+01 3.5664642E+01
+-7.6181862E+01 3.5666210E+01-7.6178238E+01 3.5654472E+01
+-7.6184486E+01 3.5648239E+01-7.6193619E+01 3.5645493E+01
+-7.6194656E+01 3.5635628E+01-7.6197678E+01 3.5636108E+01
+-7.6196388E+01 3.5633335E+01-7.6199135E+01 3.5633705E+01
+-7.6195129E+01 3.5628551E+01-7.6196732E+01 3.5622513E+01
+-7.6199898E+01 3.5621964E+01-7.6195946E+01 3.5620132E+01
+-7.6200233E+01 3.5618069E+01-7.6198494E+01 3.5616562E+01
+-7.6201836E+01 3.5614933E+01-7.6201607E+01 3.5612183E+01
+-7.6207687E+01 3.5609985E+01-7.6205505E+01 3.5607536E+01
+-7.6208473E+01 3.5602909E+01-7.6216187E+01 3.5597824E+01
+-7.6225464E+01 3.5601391E+01-7.6230064E+01 3.5599445E+01
+-7.6247131E+01 3.5602421E+01-7.6252922E+01 3.5605644E+01
+-7.6265480E+01 3.5603157E+01-7.6270729E+01 3.5607761E+01
+-7.6277428E+01 3.5605198E+01-7.6286987E+01 3.5604946E+01
+-7.6298203E+01 3.5608887E+01-7.6269669E+01 3.5690552E+01
+-7.6395630E+01 3.5697304E+01
+ 163 44201 122 111 58 53 10
+-7.8064888E+01 3.5585258E+01-7.8125854E+01 3.5602886E+01
+-7.8162445E+01 3.5696232E+01-7.8162483E+01 3.5713135E+01
+-7.8168114E+01 3.5713413E+01-7.8177315E+01 3.5718246E+01
+-7.8176552E+01 3.5721931E+01-7.8179787E+01 3.5722366E+01
+-7.8180511E+01 3.5726624E+01-7.8192352E+01 3.5730289E+01
+ 164 34973 123 94 52 38 6
+-7.8915169E+01 3.5583328E+01-7.8995880E+01 3.5610176E+01
+-7.8939575E+01 3.5759670E+01-7.8931183E+01 3.5794125E+01
+-7.8909523E+01 3.5842754E+01-7.8906273E+01 3.5867786E+01
+ 165 33061 125 124 45 66 27
+-8.1824364E+01 3.5574829E+01-8.1822830E+01 3.5580307E+01
+-8.1818489E+01 3.5577915E+01-8.1810600E+01 3.5581081E+01
+-8.1803864E+01 3.5578346E+01-8.1799797E+01 3.5579365E+01
+-8.1793930E+01 3.5593082E+01-8.1772362E+01 3.5592442E+01
+-8.1768372E+01 3.5596790E+01-8.1772095E+01 3.5601833E+01
+-8.1754875E+01 3.5612190E+01-8.1750557E+01 3.5610332E+01
+-8.1745995E+01 3.5603729E+01-8.1742096E+01 3.5604462E+01
+-8.1736618E+01 3.5601696E+01-8.1720100E+01 3.5606873E+01
+-8.1716164E+01 3.5602661E+01-8.1717613E+01 3.5600574E+01
+-8.1715454E+01 3.5601284E+01-8.1717506E+01 3.5595627E+01
+-8.1715958E+01 3.5596409E+01-8.1712234E+01 3.5589149E+01
+-8.1709625E+01 3.5589493E+01-8.1705643E+01 3.5580860E+01
+-8.1702637E+01 3.5583221E+01-8.1697792E+01 3.5578590E+01
+-8.1692513E+01 3.5579659E+01
+ 166 30562 85 125 45 49 24
+-8.1943840E+01 3.5959324E+01-8.1937546E+01 3.5955330E+01
+-8.1931534E+01 3.5946655E+01-8.1932823E+01 3.5941250E+01
+-8.1925781E+01 3.5937080E+01-8.1929077E+01 3.5931374E+01
+-8.1921089E+01 3.5918877E+01-8.1914932E+01 3.5916145E+01
+-8.1910851E+01 3.5905338E+01-8.1914551E+01 3.5901455E+01
+-8.1909546E+01 3.5897903E+01-8.1906776E+01 3.5883312E+01
+-8.1918152E+01 3.5860332E+01-8.1918007E+01 3.5851334E+01
+-8.1920937E+01 3.5846409E+01-8.1935043E+01 3.5837440E+01
+-8.1940170E+01 3.5837498E+01-8.1947815E+01 3.5825661E+01
+-8.1958023E+01 3.5819798E+01-8.1965675E+01 3.5818352E+01
+-8.1973877E+01 3.5821053E+01-8.1987198E+01 3.5806812E+01
+-8.1869537E+01 3.5719429E+01-8.1824364E+01 3.5574829E+01
+ 167 34361 126 120 62 48 10
+-7.5867485E+01 3.5574020E+01-7.5869102E+01 3.5579361E+01
+-7.5879555E+01 3.5604012E+01-7.5877777E+01 3.5629124E+01
+-7.5884338E+01 3.5632614E+01-7.5892334E+01 3.5643150E+01
+-7.5891289E+01 3.5651691E+01-7.5900124E+01 3.5662411E+01
+-7.5901543E+01 3.5668831E+01-7.6027817E+01 3.5668945E+01
+ 168 39536 127 121 53 64 3
+-7.7823906E+01 3.5572544E+01-7.7753944E+01 3.5615662E+01
+-7.7700806E+01 3.5652100E+01
+ 169 41564 127 122 67 53 5
+-7.7823906E+01 3.5572544E+01-7.7823769E+01 3.5585365E+01
+-7.7998672E+01 3.5585476E+01-7.8058250E+01 3.5597610E+01
+-7.8064888E+01 3.5585258E+01
+ 170 160 126 91 48 1 19
+-7.5867485E+01 3.5574020E+01-7.5819817E+01 3.5570839E+01
+-7.5767891E+01 3.5580662E+01-7.5731407E+01 3.5625568E+01
+-7.5713158E+01 3.5699940E+01-7.5725792E+01 3.5806587E+01
+-7.5749649E+01 3.5885174E+01-7.5781921E+01 3.5935688E+01
+-7.5805779E+01 3.5956738E+01-7.5853485E+01 3.5974979E+01
+-7.5895592E+01 3.5974979E+01-7.5932076E+01 3.5967964E+01
+-7.5947510E+01 3.5959545E+01-7.5925056E+01 3.5939896E+01
+-7.5937691E+01 3.5924461E+01-7.5955925E+01 3.5911831E+01
+-7.5964355E+01 3.5899204E+01-7.5981186E+01 3.5896397E+01
+-7.5995079E+01 3.5908951E+01
+ 171 32895 129 108 45 56 5
+-8.1534546E+01 3.5568680E+01-8.1506210E+01 3.5608097E+01
+-8.1500000E+01 3.5611050E+01-8.1420067E+01 3.5692715E+01
+-8.1364250E+01 3.5767735E+01
+ 172 32981 130 129 45 70 2
+-8.1537811E+01 3.5564140E+01-8.1534546E+01 3.5568680E+01
+ 173 31295 117 128 63 1 50
+-8.3254356E+01 3.5695713E+01-8.3259285E+01 3.5690079E+01
+-8.3269737E+01 3.5686085E+01-8.3271507E+01 3.5681381E+01
+-8.3281303E+01 3.5677704E+01-8.3283630E+01 3.5674709E+01
+-8.3289291E+01 3.5674412E+01-8.3293800E+01 3.5661823E+01
+-8.3298805E+01 3.5656906E+01-8.3312881E+01 3.5654713E+01
+-8.3321220E+01 3.5662720E+01-8.3335091E+01 3.5665375E+01
+-8.3337807E+01 3.5662979E+01-8.3341667E+01 3.5664009E+01
+-8.3351677E+01 3.5659763E+01-8.3358330E+01 3.5646835E+01
+-8.3367065E+01 3.5638634E+01-8.3372299E+01 3.5639217E+01
+-8.3378105E+01 3.5634399E+01-8.3388840E+01 3.5633488E+01
+-8.3392776E+01 3.5625000E+01-8.3396744E+01 3.5622623E+01
+-8.3406181E+01 3.5620090E+01-8.3421700E+01 3.5611092E+01
+-8.3432419E+01 3.5609848E+01-8.3445923E+01 3.5611710E+01
+-8.3455208E+01 3.5601841E+01-8.3455841E+01 3.5597954E+01
+-8.3462791E+01 3.5592506E+01-8.3471481E+01 3.5590214E+01
+-8.3472992E+01 3.5586285E+01-8.3479202E+01 3.5583225E+01
+-8.3478638E+01 3.5579109E+01-8.3485352E+01 3.5568340E+01
+-8.3494041E+01 3.5566475E+01-8.3498451E+01 3.5562889E+01
+-8.3517677E+01 3.5562778E+01-8.3520584E+01 3.5565510E+01
+-8.3552277E+01 3.5564251E+01-8.3566200E+01 3.5565899E+01
+-8.3585701E+01 3.5562847E+01-8.3594383E+01 3.5572819E+01
+-8.3604919E+01 3.5579247E+01-8.3609001E+01 3.5579361E+01
+-8.3615425E+01 3.5573936E+01-8.3629845E+01 3.5567799E+01
+-8.3634682E+01 3.5570232E+01-8.3641075E+01 3.5565620E+01
+-8.3655518E+01 3.5569748E+01-8.3663063E+01 3.5569050E+01
+ 174 32980 124 130 45 68 20
+-8.1692513E+01 3.5579659E+01-8.1690414E+01 3.5584091E+01
+-8.1674019E+01 3.5568104E+01-8.1668549E+01 3.5566090E+01
+-8.1662216E+01 3.5567196E+01-8.1649361E+01 3.5561481E+01
+-8.1637581E+01 3.5564014E+01-8.1633987E+01 3.5566967E+01
+-8.1633148E+01 3.5565159E+01-8.1618973E+01 3.5566967E+01
+-8.1617432E+01 3.5565117E+01-8.1596489E+01 3.5571045E+01
+-8.1591141E+01 3.5564747E+01-8.1581009E+01 3.5567371E+01
+-8.1577202E+01 3.5566208E+01-8.1579163E+01 3.5561970E+01
+-8.1573212E+01 3.5558357E+01-8.1567177E+01 3.5558136E+01
+-8.1561012E+01 3.5562828E+01-8.1537811E+01 3.5564140E+01
+ 175 29982 131 107 56 42 30
+-8.0960236E+01 3.5547676E+01-8.0953606E+01 3.5554321E+01
+-8.0956978E+01 3.5567410E+01-8.0954880E+01 3.5575336E+01
+-8.0950401E+01 3.5581360E+01-8.0932938E+01 3.5591873E+01
+-8.0934898E+01 3.5597588E+01-8.0942299E+01 3.5603477E+01
+-8.0942154E+01 3.5608059E+01-8.0924179E+01 3.5620728E+01
+-8.0953659E+01 3.5643517E+01-8.0960953E+01 3.5660240E+01
+-8.0965767E+01 3.5663731E+01-8.0966858E+01 3.5670784E+01
+-8.0980736E+01 3.5680820E+01-8.0987343E+01 3.5692345E+01
+-8.0990425E+01 3.5693016E+01-8.0997154E+01 3.5704391E+01
+-8.1003586E+01 3.5709171E+01-8.1018578E+01 3.5712444E+01
+-8.1041901E+01 3.5706993E+01-8.1062950E+01 3.5711639E+01
+-8.1065819E+01 3.5719044E+01-8.1064163E+01 3.5727741E+01
+-8.1067879E+01 3.5737785E+01-8.1090622E+01 3.5757137E+01
+-8.1089661E+01 3.5765762E+01-8.1093681E+01 3.5768616E+01
+-8.1102325E+01 3.5768051E+01-8.1112083E+01 3.5779045E+01
+ 176 34756 129 131 56 70 2
+-8.1534546E+01 3.5568680E+01-8.0960236E+01 3.5547676E+01
+ 177 32220 132 114 57 49 22
+-8.2169182E+01 3.5527721E+01-8.2220146E+01 3.5553017E+01
+-8.2251022E+01 3.5559547E+01-8.2290962E+01 3.5591171E+01
+-8.2291962E+01 3.5594971E+01-8.2287788E+01 3.5600887E+01
+-8.2282455E+01 3.5603085E+01-8.2280579E+01 3.5608635E+01
+-8.2264839E+01 3.5614250E+01-8.2264587E+01 3.5617645E+01
+-8.2274078E+01 3.5627964E+01-8.2270981E+01 3.5631969E+01
+-8.2275963E+01 3.5637234E+01-8.2281715E+01 3.5638916E+01
+-8.2283012E+01 3.5646351E+01-8.2285751E+01 3.5647903E+01
+-8.2286667E+01 3.5657688E+01-8.2281090E+01 3.5669136E+01
+-8.2284424E+01 3.5676548E+01-8.2294930E+01 3.5683517E+01
+-8.2289207E+01 3.5695969E+01-8.2275551E+01 3.5704308E+01
+ 178 35138 133 123 52 69 2
+-7.8970894E+01 3.5522087E+01-7.8915169E+01 3.5583328E+01
+ 179 40491 134 103 38 58 6
+-7.8708893E+01 3.5518925E+01-7.8505997E+01 3.5675785E+01
+-7.8469627E+01 3.5706448E+01-7.8464645E+01 3.5708271E+01
+-7.8460327E+01 3.5705555E+01-7.8255203E+01 3.5817451E+01
+ 180 35145 134 123 69 38 2
+-7.8708893E+01 3.5518925E+01-7.8915169E+01 3.5583328E+01
+ 181 34738 131 135 42 70 8
+-8.0960236E+01 3.5547676E+01-8.0958229E+01 3.5543781E+01
+-8.0947693E+01 3.5537373E+01-8.0941673E+01 3.5528141E+01
+-8.0946503E+01 3.5527069E+01-8.0955551E+01 3.5532543E+01
+-8.0957771E+01 3.5525925E+01-8.0955902E+01 3.5518200E+01
+ 182 33065 125 132 66 49 18
+-8.1824364E+01 3.5574829E+01-8.1829689E+01 3.5571632E+01
+-8.1829659E+01 3.5568005E+01-8.1833832E+01 3.5563416E+01
+-8.1833351E+01 3.5558643E+01-8.1841148E+01 3.5553761E+01
+-8.1844101E+01 3.5545643E+01-8.1842834E+01 3.5542034E+01
+-8.1973724E+01 3.5524441E+01-8.1986465E+01 3.5537956E+01
+-8.1986458E+01 3.5540562E+01-8.1994629E+01 3.5543858E+01
+-8.2002960E+01 3.5551708E+01-8.2013069E+01 3.5547600E+01
+-8.2022758E+01 3.5537022E+01-8.2072227E+01 3.5536453E+01
+-8.2150711E+01 3.5517879E+01-8.2169182E+01 3.5527721E+01
+ 183 35150 137 133 52 65 45
+-7.9350357E+01 3.5517841E+01-7.9339302E+01 3.5521164E+01
+-7.9334938E+01 3.5524963E+01-7.9325050E+01 3.5523659E+01
+-7.9315750E+01 3.5528240E+01-7.9311890E+01 3.5532776E+01
+-7.9323929E+01 3.5543858E+01-7.9314545E+01 3.5543949E+01
+-7.9304092E+01 3.5548138E+01-7.9304375E+01 3.5551548E+01
+-7.9300255E+01 3.5553036E+01-7.9284958E+01 3.5554913E+01
+-7.9282661E+01 3.5551567E+01-7.9290871E+01 3.5546261E+01
+-7.9291573E+01 3.5540169E+01-7.9276901E+01 3.5531898E+01
+-7.9267075E+01 3.5533157E+01-7.9246025E+01 3.5552681E+01
+-7.9243484E+01 3.5570107E+01-7.9222977E+01 3.5568535E+01
+-7.9219162E+01 3.5565948E+01-7.9222069E+01 3.5558552E+01
+-7.9226830E+01 3.5554268E+01-7.9224258E+01 3.5550701E+01
+-7.9215691E+01 3.5555233E+01-7.9200668E+01 3.5558533E+01
+-7.9201447E+01 3.5576324E+01-7.9186913E+01 3.5579865E+01
+-7.9158333E+01 3.5603195E+01-7.9150360E+01 3.5616814E+01
+-7.9142723E+01 3.5622517E+01-7.9125000E+01 3.5623932E+01
+-7.9118965E+01 3.5628010E+01-7.9112556E+01 3.5622543E+01
+-7.9098595E+01 3.5622723E+01-7.9093475E+01 3.5618523E+01
+-7.9069069E+01 3.5608433E+01-7.9052689E+01 3.5595875E+01
+-7.9052147E+01 3.5585365E+01-7.9047081E+01 3.5577469E+01
+-7.9046989E+01 3.5569420E+01-7.9024445E+01 3.5548019E+01
+-7.9015572E+01 3.5543270E+01-7.8992760E+01 3.5540623E+01
+-7.8970894E+01 3.5522087E+01
+ 184 35222 138 137 52 73 2
+-7.9556152E+01 3.5515007E+01-7.9350357E+01 3.5517841E+01
+ 185 29384 99 138 52 51 2
+-7.9542778E+01 3.5843235E+01-7.9556152E+01 3.5515007E+01
+ 186 43077 117 136 59 63 36
+-8.3254356E+01 3.5695713E+01-8.3236351E+01 3.5695396E+01
+-8.3215279E+01 3.5691837E+01-8.3206100E+01 3.5680485E+01
+-8.3199913E+01 3.5680634E+01-8.3193001E+01 3.5677689E+01
+-8.3187424E+01 3.5672020E+01-8.3182022E+01 3.5671028E+01
+-8.3195091E+01 3.5660820E+01-8.3196777E+01 3.5654442E+01
+-8.3202881E+01 3.5648979E+01-8.3202194E+01 3.5642834E+01
+-8.3200569E+01 3.5639763E+01-8.3188400E+01 3.5641090E+01
+-8.3177704E+01 3.5631287E+01-8.3176376E+01 3.5626743E+01
+-8.3181259E+01 3.5622997E+01-8.3182030E+01 3.5618484E+01
+-8.3176109E+01 3.5612419E+01-8.3185936E+01 3.5598812E+01
+-8.3183311E+01 3.5596073E+01-8.3183594E+01 3.5586281E+01
+-8.3175301E+01 3.5580677E+01-8.3167267E+01 3.5578648E+01
+-8.3162323E+01 3.5568207E+01-8.3163513E+01 3.5564564E+01
+-8.3160149E+01 3.5562355E+01-8.3156403E+01 3.5552975E+01
+-8.3164986E+01 3.5544922E+01-8.3165283E+01 3.5538643E+01
+-8.3171875E+01 3.5537273E+01-8.3170097E+01 3.5530952E+01
+-8.3173378E+01 3.5528790E+01-8.3174065E+01 3.5521507E+01
+-8.3184715E+01 3.5514259E+01-8.3195366E+01 3.5518150E+01
+ 187 35255 138 139 73 51 2
+-7.9556152E+01 3.5515007E+01-7.9774185E+01 3.5511337E+01
+ 188 38031 140 98 42 54 4
+-8.0737312E+01 3.5506985E+01-8.0740128E+01 3.5544353E+01
+-8.0771759E+01 3.5674789E+01-8.0708008E+01 3.5852615E+01
+ 189 33161 141 140 42 75 2
+-8.0784279E+01 3.5506962E+01-8.0737312E+01 3.5506985E+01
+ 190 33173 135 141 42 72 2
+-8.0955902E+01 3.5518200E+01-8.0784279E+01 3.5506962E+01
+ 191 46083 139 142 74 51 2
+-7.9774185E+01 3.5511337E+01-8.0066971E+01 3.5505749E+01
+ 192 37586 142 89 44 51 2
+-8.0066971E+01 3.5505749E+01-8.0047302E+01 3.5920502E+01
+ 193 37672 142 143 74 44 2
+-8.0066971E+01 3.5505749E+01-8.0182907E+01 3.5504196E+01
+ 194 37310 109 143 44 54 30
+-8.0459129E+01 3.5742672E+01-8.0453918E+01 3.5734474E+01
+-8.0443420E+01 3.5734650E+01-8.0413269E+01 3.5722179E+01
+-8.0404793E+01 3.5722134E+01-8.0395912E+01 3.5725014E+01
+-8.0389175E+01 3.5719219E+01-8.0370071E+01 3.5716099E+01
+-8.0339691E+01 3.5721249E+01-8.0333290E+01 3.5719788E+01
+-8.0324318E+01 3.5707970E+01-8.0324913E+01 3.5703522E+01
+-8.0334175E+01 3.5693073E+01-8.0334061E+01 3.5685867E+01
+-8.0330299E+01 3.5678608E+01-8.0307999E+01 3.5666962E+01
+-8.0304459E+01 3.5653442E+01-8.0289040E+01 3.5636166E+01
+-8.0262817E+01 3.5628380E+01-8.0240593E+01 3.5611519E+01
+-8.0232597E+01 3.5597107E+01-8.0208397E+01 3.5580265E+01
+-8.0210205E+01 3.5552685E+01-8.0199341E+01 3.5545284E+01
+-8.0195724E+01 3.5537254E+01-8.0197166E+01 3.5529675E+01
+-8.0190704E+01 3.5525597E+01-8.0184570E+01 3.5517326E+01
+-8.0185150E+01 3.5508324E+01-8.0182907E+01 3.5504196E+01
+ 195 33424 144 143 54 76 2
+-8.0295616E+01 3.5502964E+01-8.0182907E+01 3.5504196E+01
+ 196 33416 144 140 75 54 3
+-8.0295616E+01 3.5502964E+01-8.0451645E+01 3.5501869E+01
+-8.0737312E+01 3.5506985E+01
+ 197 29853 128 147 63 1 33
+-8.3663063E+01 3.5569050E+01-8.3680443E+01 3.5570225E+01
+-8.3688896E+01 3.5567699E+01-8.3696777E+01 3.5570152E+01
+-8.3700768E+01 3.5567532E+01-8.3707306E+01 3.5568443E+01
+-8.3723572E+01 3.5561783E+01-8.3729851E+01 3.5564060E+01
+-8.3733055E+01 3.5563061E+01-8.3735779E+01 3.5565369E+01
+-8.3748177E+01 3.5559761E+01-8.3757027E+01 3.5563515E+01
+-8.3771843E+01 3.5562031E+01-8.3773201E+01 3.5557377E+01
+-8.3780235E+01 3.5550301E+01-8.3794342E+01 3.5545242E+01
+-8.3798973E+01 3.5540958E+01-8.3802536E+01 3.5541500E+01
+-8.3825699E+01 3.5523743E+01-8.3832001E+01 3.5524681E+01
+-8.3848610E+01 3.5519173E+01-8.3859360E+01 3.5521763E+01
+-8.3880173E+01 3.5518661E+01-8.3892174E+01 3.5503002E+01
+-8.3901482E+01 3.5496468E+01-8.3900436E+01 3.5493011E+01
+-8.3905708E+01 3.5488976E+01-8.3911873E+01 3.5475945E+01
+-8.3916901E+01 3.5473530E+01-8.3924561E+01 3.5474312E+01
+-8.3937111E+01 3.5471428E+01-8.3942940E+01 3.5464485E+01
+-8.3952972E+01 3.5460552E+01
+ 198 29853 147 146 78 1 3
+-8.3952972E+01 3.5460552E+01-8.3956520E+01 3.5463783E+01
+-8.3961151E+01 3.5463657E+01
+ 199 32121 145 132 57 66 8
+-8.2266029E+01 3.5467503E+01-8.2251480E+01 3.5460430E+01
+-8.2242744E+01 3.5467892E+01-8.2224472E+01 3.5498421E+01
+-8.2227417E+01 3.5504616E+01-8.2233589E+01 3.5509750E+01
+-8.2233322E+01 3.5519382E+01-8.2169182E+01 3.5527721E+01
+ 200 39530 121 148 55 64 47
+-7.7700806E+01 3.5652100E+01-7.7690361E+01 3.5649780E+01
+-7.7683655E+01 3.5643944E+01-7.7680878E+01 3.5638657E+01
+-7.7682793E+01 3.5632385E+01-7.7677094E+01 3.5625408E+01
+-7.7662506E+01 3.5618816E+01-7.7628792E+01 3.5585407E+01
+-7.7621696E+01 3.5581978E+01-7.7610931E+01 3.5567657E+01
+-7.7591743E+01 3.5563152E+01-7.7581848E+01 3.5553658E+01
+-7.7570793E+01 3.5548187E+01-7.7566055E+01 3.5538986E+01
+-7.7558105E+01 3.5531872E+01-7.7543541E+01 3.5533035E+01
+-7.7534843E+01 3.5529396E+01-7.7530975E+01 3.5530106E+01
+-7.7523102E+01 3.5525135E+01-7.7525352E+01 3.5519505E+01
+-7.7522217E+01 3.5517513E+01-7.7510597E+01 3.5519455E+01
+-7.7507355E+01 3.5516819E+01-7.7503769E+01 3.5517895E+01
+-7.7505981E+01 3.5510159E+01-7.7511559E+01 3.5507778E+01
+-7.7507805E+01 3.5505913E+01-7.7507446E+01 3.5502079E+01
+-7.7512070E+01 3.5497200E+01-7.7502563E+01 3.5491772E+01
+-7.7503151E+01 3.5485844E+01-7.7501137E+01 3.5486279E+01
+-7.7498917E+01 3.5479710E+01-7.7494362E+01 3.5477077E+01
+-7.7494698E+01 3.5473301E+01-7.7491020E+01 3.5468842E+01
+-7.7493538E+01 3.5462612E+01-7.7484642E+01 3.5457832E+01
+-7.7485580E+01 3.5452747E+01-7.7481056E+01 3.5451607E+01
+-7.7484711E+01 3.5445354E+01-7.7481575E+01 3.5443687E+01
+-7.7480659E+01 3.5446640E+01-7.7477158E+01 3.5445293E+01
+-7.7479782E+01 3.5439339E+01-7.7474861E+01 3.5440121E+01
+-7.7476311E+01 3.5426525E+01
+ 201 31921 149 118 59 57 42
+-8.2745361E+01 3.5422817E+01-8.2747421E+01 3.5425037E+01
+-8.2756325E+01 3.5425220E+01-8.2766479E+01 3.5432613E+01
+-8.2781822E+01 3.5439201E+01-8.2786034E+01 3.5456738E+01
+-8.2794579E+01 3.5465027E+01-8.2794571E+01 3.5469193E+01
+-8.2800423E+01 3.5470428E+01-8.2785797E+01 3.5494804E+01
+-8.2786591E+01 3.5498035E+01-8.2782730E+01 3.5504517E+01
+-8.2785248E+01 3.5507263E+01-8.2778183E+01 3.5519951E+01
+-8.2780563E+01 3.5525394E+01-8.2766357E+01 3.5538525E+01
+-8.2771225E+01 3.5550186E+01-8.2777771E+01 3.5555531E+01
+-8.2766472E+01 3.5568169E+01-8.2771408E+01 3.5576077E+01
+-8.2778603E+01 3.5577850E+01-8.2777321E+01 3.5582100E+01
+-8.2780739E+01 3.5588501E+01-8.2798950E+01 3.5597187E+01
+-8.2803673E+01 3.5610577E+01-8.2809662E+01 3.5618053E+01
+-8.2811256E+01 3.5626862E+01-8.2814575E+01 3.5627644E+01
+-8.2829170E+01 3.5620041E+01-8.2836540E+01 3.5620983E+01
+-8.2845993E+01 3.5614265E+01-8.2851601E+01 3.5617233E+01
+-8.2851593E+01 3.5634708E+01-8.2853851E+01 3.5636814E+01
+-8.2865166E+01 3.5634415E+01-8.2868675E+01 3.5645088E+01
+-8.2874725E+01 3.5651325E+01-8.2872162E+01 3.5657211E+01
+-8.2878265E+01 3.5662445E+01-8.2876770E+01 3.5665627E+01
+-8.2888237E+01 3.5672932E+01-8.2884171E+01 3.5678082E+01
+ 202 32998 150 130 68 70 6
+-8.1456696E+01 3.5419483E+01-8.1477806E+01 3.5464172E+01
+-8.1512650E+01 3.5522282E+01-8.1507736E+01 3.5545601E+01
+-8.1519577E+01 3.5557762E+01-8.1537811E+01 3.5564140E+01
+ 203 30936 110 151 61 55 75
+-7.7174057E+01 3.5732796E+01-7.7175041E+01 3.5725903E+01
+-7.7172287E+01 3.5724693E+01-7.7170776E+01 3.5716427E+01
+-7.7184662E+01 3.5720413E+01-7.7187134E+01 3.5712444E+01
+-7.7193787E+01 3.5709217E+01-7.7194321E+01 3.5695114E+01
+-7.7190247E+01 3.5693264E+01-7.7187340E+01 3.5694958E+01
+-7.7181213E+01 3.5692760E+01-7.7180008E+01 3.5685020E+01
+-7.7177513E+01 3.5683968E+01-7.7174988E+01 3.5687061E+01
+-7.7170525E+01 3.5684929E+01-7.7169823E+01 3.5678246E+01
+-7.7172691E+01 3.5677284E+01-7.7167473E+01 3.5672382E+01
+-7.7172318E+01 3.5668903E+01-7.7177597E+01 3.5669273E+01
+-7.7180992E+01 3.5665195E+01-7.7174828E+01 3.5657871E+01
+-7.7174179E+01 3.5635460E+01-7.7168205E+01 3.5630997E+01
+-7.7162827E+01 3.5633125E+01-7.7161957E+01 3.5629208E+01
+-7.7157249E+01 3.5626373E+01-7.7153206E+01 3.5626759E+01
+-7.7148277E+01 3.5620132E+01-7.7143990E+01 3.5620453E+01
+-7.7142845E+01 3.5618481E+01-7.7145851E+01 3.5608524E+01
+-7.7140327E+01 3.5605457E+01-7.7142349E+01 3.5603668E+01
+-7.7147087E+01 3.5605068E+01-7.7150726E+01 3.5602093E+01
+-7.7146133E+01 3.5602203E+01-7.7143051E+01 3.5598633E+01
+-7.7139130E+01 3.5601974E+01-7.7135117E+01 3.5596294E+01
+-7.7129990E+01 3.5594440E+01-7.7129318E+01 3.5595879E+01
+-7.7128365E+01 3.5593616E+01-7.7126915E+01 3.5597073E+01
+-7.7124710E+01 3.5596313E+01-7.7122337E+01 3.5591896E+01
+-7.7125748E+01 3.5584591E+01-7.7118355E+01 3.5582901E+01
+-7.7118385E+01 3.5586582E+01-7.7114822E+01 3.5588329E+01
+-7.7117203E+01 3.5580933E+01-7.7114738E+01 3.5580040E+01
+-7.7109947E+01 3.5582695E+01-7.7107079E+01 3.5581165E+01
+-7.7111984E+01 3.5574821E+01-7.7110519E+01 3.5569214E+01
+-7.7107162E+01 3.5570908E+01-7.7101837E+01 3.5569653E+01
+-7.7101555E+01 3.5565643E+01-7.7097801E+01 3.5564411E+01
+-7.7091042E+01 3.5568825E+01-7.7087799E+01 3.5563831E+01
+-7.7089890E+01 3.5559547E+01-7.7085968E+01 3.5551781E+01
+-7.7114777E+01 3.5549599E+01-7.7127441E+01 3.5553551E+01
+-7.7176407E+01 3.5519016E+01-7.7176918E+01 3.5501488E+01
+-7.7167229E+01 3.5497021E+01-7.7176682E+01 3.5484863E+01
+-7.7174263E+01 3.5456551E+01-7.7181099E+01 3.5455120E+01
+-7.7181602E+01 3.5440811E+01-7.7191414E+01 3.5434975E+01
+-7.7190742E+01 3.5418793E+01
+ 204 32089 145 149 77 57 63
+-8.2266029E+01 3.5467503E+01-8.2332764E+01 3.5500000E+01
+-8.2337685E+01 3.5498486E+01-8.2341011E+01 3.5489136E+01
+-8.2345642E+01 3.5488010E+01-8.2356346E+01 3.5490646E+01
+-8.2360100E+01 3.5485298E+01-8.2369408E+01 3.5485229E+01
+-8.2371971E+01 3.5479641E+01-8.2370522E+01 3.5470955E+01
+-8.2367630E+01 3.5463989E+01-8.2363174E+01 3.5460861E+01
+-8.2380707E+01 3.5463329E+01-8.2388435E+01 3.5469887E+01
+-8.2402367E+01 3.5469936E+01-8.2407249E+01 3.5473633E+01
+-8.2410851E+01 3.5472130E+01-8.2417747E+01 3.5474415E+01
+-8.2427261E+01 3.5470352E+01-8.2432449E+01 3.5464241E+01
+-8.2445747E+01 3.5461086E+01-8.2446716E+01 3.5458416E+01
+-8.2453888E+01 3.5455486E+01-8.2455917E+01 3.5449535E+01
+-8.2461983E+01 3.5450607E+01-8.2470322E+01 3.5445248E+01
+-8.2534943E+01 3.5443760E+01-8.2536278E+01 3.5436657E+01
+-8.2529205E+01 3.5436401E+01-8.2529961E+01 3.5422817E+01
+-8.2535599E+01 3.5422493E+01-8.2533112E+01 3.5416534E+01
+-8.2536095E+01 3.5422321E+01-8.2538589E+01 3.5421410E+01
+-8.2546890E+01 3.5425541E+01-8.2542694E+01 3.5431072E+01
+-8.2546722E+01 3.5440289E+01-8.2549118E+01 3.5440369E+01
+-8.2548897E+01 3.5444191E+01-8.2558739E+01 3.5443985E+01
+-8.2561539E+01 3.5442719E+01-8.2562340E+01 3.5437355E+01
+-8.2568062E+01 3.5437920E+01-8.2569984E+01 3.5431175E+01
+-8.2584839E+01 3.5433968E+01-8.2590561E+01 3.5437809E+01
+-8.2595520E+01 3.5435764E+01-8.2608429E+01 3.5443104E+01
+-8.2618851E+01 3.5439873E+01-8.2622009E+01 3.5435360E+01
+-8.2641998E+01 3.5444351E+01-8.2644257E+01 3.5448753E+01
+-8.2653137E+01 3.5454769E+01-8.2659309E+01 3.5452240E+01
+-8.2672546E+01 3.5459423E+01-8.2680351E+01 3.5453697E+01
+-8.2701057E+01 3.5454128E+01-8.2714973E+01 3.5448498E+01
+-8.2729584E+01 3.5435791E+01-8.2731026E+01 3.5432098E+01
+-8.2739853E+01 3.5429176E+01-8.2741669E+01 3.5424431E+01
+-8.2745361E+01 3.5422817E+01
+ 205 43865 152 135 70 72 13
+-8.0955589E+01 3.5400696E+01-8.0958977E+01 3.5413071E+01
+-8.0955406E+01 3.5421310E+01-8.0958893E+01 3.5432499E+01
+-8.0942490E+01 3.5456177E+01-8.0951950E+01 3.5468315E+01
+-8.0945419E+01 3.5483772E+01-8.0947861E+01 3.5490280E+01
+-8.0959808E+01 3.5495461E+01-8.0963692E+01 3.5500000E+01
+-8.0964279E+01 3.5505978E+01-8.0956665E+01 3.5513668E+01
+-8.0955902E+01 3.5518200E+01
+ 206 34763 150 152 70 81 2
+-8.1456696E+01 3.5419483E+01-8.0955589E+01 3.5400696E+01
+ 207 32091 153 145 77 66 9
+-8.2261627E+01 3.5392868E+01-8.2270416E+01 3.5400234E+01
+-8.2268852E+01 3.5406292E+01-8.2272842E+01 3.5409431E+01
+-8.2273209E+01 3.5418716E+01-8.2275993E+01 3.5422974E+01
+-8.2273575E+01 3.5430222E+01-8.2280670E+01 3.5442089E+01
+-8.2266029E+01 3.5467503E+01
+ 208 30896 154 113 61 62 46
+-7.6549194E+01 3.5391922E+01-7.6558884E+01 3.5403419E+01
+-7.6563362E+01 3.5424252E+01-7.6575897E+01 3.5436394E+01
+-7.6584351E+01 3.5449001E+01-7.6585426E+01 3.5457195E+01
+-7.6579826E+01 3.5485085E+01-7.6601555E+01 3.5497547E+01
+-7.6604462E+01 3.5512199E+01-7.6599434E+01 3.5519791E+01
+-7.6587082E+01 3.5523075E+01-7.6563225E+01 3.5519875E+01
+-7.6525269E+01 3.5518501E+01-7.6491539E+01 3.5520699E+01
+-7.6478920E+01 3.5530888E+01-7.6468071E+01 3.5550949E+01
+-7.6468124E+01 3.5556362E+01-7.6481606E+01 3.5563606E+01
+-7.6483017E+01 3.5567192E+01-7.6491447E+01 3.5572372E+01
+-7.6501144E+01 3.5570663E+01-7.6505203E+01 3.5575588E+01
+-7.6501411E+01 3.5579411E+01-7.6506828E+01 3.5580616E+01
+-7.6514015E+01 3.5574890E+01-7.6519302E+01 3.5577599E+01
+-7.6518944E+01 3.5584503E+01-7.6525414E+01 3.5585144E+01
+-7.6528587E+01 3.5581055E+01-7.6539261E+01 3.5582573E+01
+-7.6539970E+01 3.5585548E+01-7.6534637E+01 3.5589439E+01
+-7.6534027E+01 3.5594982E+01-7.6542961E+01 3.5598831E+01
+-7.6551544E+01 3.5596313E+01-7.6554962E+01 3.5599815E+01
+-7.6563202E+01 3.5600277E+01-7.6573967E+01 3.5607853E+01
+-7.6574898E+01 3.5610828E+01-7.6578201E+01 3.5610966E+01
+-7.6580170E+01 3.5614948E+01-7.6592651E+01 3.5624519E+01
+-7.6606483E+01 3.5646660E+01-7.6600403E+01 3.5664383E+01
+-7.6601837E+01 3.5669651E+01-7.6638641E+01 3.5705070E+01
+ 209 41546 127 155 64 67 6
+-7.7823906E+01 3.5572544E+01-7.7827904E+01 3.5435181E+01
+-7.7824928E+01 3.5422993E+01-7.7805374E+01 3.5406288E+01
+-7.7800484E+01 3.5381996E+01-7.7806023E+01 3.5369659E+01
+ 210 36285 148 155 79 64 37
+-7.7476311E+01 3.5426525E+01-7.7483307E+01 3.5422585E+01
+-7.7481895E+01 3.5415260E+01-7.7483910E+01 3.5413906E+01
+-7.7495399E+01 3.5411980E+01-7.7499374E+01 3.5414200E+01
+-7.7499062E+01 3.5417175E+01-7.7507843E+01 3.5419106E+01
+-7.7506828E+01 3.5421803E+01-7.7510887E+01 3.5421440E+01
+-7.7521179E+01 3.5417370E+01-7.7520844E+01 3.5414921E+01
+-7.7528503E+01 3.5414581E+01-7.7532631E+01 3.5403419E+01
+-7.7566185E+01 3.5383430E+01-7.7581841E+01 3.5378098E+01
+-7.7585251E+01 3.5379356E+01-7.7590111E+01 3.5373417E+01
+-7.7597229E+01 3.5375759E+01-7.7602821E+01 3.5374634E+01
+-7.7607803E+01 3.5379421E+01-7.7614670E+01 3.5377583E+01
+-7.7618279E+01 3.5372147E+01-7.7628189E+01 3.5366154E+01
+-7.7637749E+01 3.5354210E+01-7.7648392E+01 3.5355083E+01
+-7.7654175E+01 3.5352337E+01-7.7658394E+01 3.5353645E+01
+-7.7672279E+01 3.5347832E+01-7.7681801E+01 3.5348289E+01
+-7.7691330E+01 3.5360874E+01-7.7690460E+01 3.5363918E+01
+-7.7697166E+01 3.5370373E+01-7.7697060E+01 3.5376060E+01
+-7.7701981E+01 3.5380436E+01-7.7777985E+01 3.5367519E+01
+-7.7806023E+01 3.5369659E+01
+ 211 36286 156 148 79 55 28
+-7.7391281E+01 3.5339886E+01-7.7393784E+01 3.5346893E+01
+-7.7401970E+01 3.5348106E+01-7.7407639E+01 3.5353050E+01
+-7.7419426E+01 3.5352234E+01-7.7421631E+01 3.5348545E+01
+-7.7426460E+01 3.5349392E+01-7.7427811E+01 3.5360767E+01
+-7.7432419E+01 3.5367451E+01-7.7440689E+01 3.5366814E+01
+-7.7447952E+01 3.5370907E+01-7.7448959E+01 3.5374550E+01
+-7.7445656E+01 3.5380520E+01-7.7453377E+01 3.5382950E+01
+-7.7455246E+01 3.5385647E+01-7.7449936E+01 3.5389080E+01
+-7.7448982E+01 3.5392792E+01-7.7452370E+01 3.5392197E+01
+-7.7452568E+01 3.5394325E+01-7.7456146E+01 3.5392811E+01
+-7.7458542E+01 3.5394047E+01-7.7456619E+01 3.5395489E+01
+-7.7463692E+01 3.5399403E+01-7.7461372E+01 3.5400845E+01
+-7.7471275E+01 3.5410160E+01-7.7470886E+01 3.5421490E+01
+-7.7473297E+01 3.5425835E+01-7.7476311E+01 3.5426525E+01
+ 212 160 157 154 61 1 7
+-7.6611359E+01 3.5334160E+01-7.6621078E+01 3.5342110E+01
+-7.6630898E+01 3.5367363E+01-7.6618271E+01 3.5398235E+01
+-7.6595818E+01 3.5389816E+01-7.6576180E+01 3.5387012E+01
+-7.6549194E+01 3.5391922E+01
+ 213 43244 136 158 71 63 41
+-8.3195366E+01 3.5518150E+01-8.3204521E+01 3.5517075E+01
+-8.3208214E+01 3.5513618E+01-8.3211075E+01 3.5517258E+01
+-8.3215103E+01 3.5518105E+01-8.3219360E+01 3.5524353E+01
+-8.3236168E+01 3.5524368E+01-8.3242043E+01 3.5518917E+01
+-8.3254776E+01 3.5513664E+01-8.3261780E+01 3.5514442E+01
+-8.3264542E+01 3.5506531E+01-8.3272606E+01 3.5504471E+01
+-8.3275620E+01 3.5500221E+01-8.3283478E+01 3.5497532E+01
+-8.3286507E+01 3.5492432E+01-8.3284935E+01 3.5489410E+01
+-8.3291740E+01 3.5482979E+01-8.3296738E+01 3.5483856E+01
+-8.3305519E+01 3.5478447E+01-8.3308990E+01 3.5479191E+01
+-8.3312073E+01 3.5471371E+01-8.3318069E+01 3.5465134E+01
+-8.3331673E+01 3.5469971E+01-8.3336571E+01 3.5474804E+01
+-8.3345215E+01 3.5473473E+01-8.3351707E+01 3.5467999E+01
+-8.3359131E+01 3.5439320E+01-8.3357376E+01 3.5437431E+01
+-8.3363876E+01 3.5426762E+01-8.3360809E+01 3.5411705E+01
+-8.3356331E+01 3.5409817E+01-8.3352051E+01 3.5411205E+01
+-8.3348083E+01 3.5405384E+01-8.3349236E+01 3.5401066E+01
+-8.3340355E+01 3.5395466E+01-8.3345863E+01 3.5389675E+01
+-8.3337555E+01 3.5381901E+01-8.3335442E+01 3.5359207E+01
+-8.3331757E+01 3.5352768E+01-8.3340431E+01 3.5337414E+01
+-8.3339828E+01 3.5330910E+01
+ 214 30756 151 156 82 55 23
+-7.7190742E+01 3.5418793E+01-7.7195030E+01 3.5417152E+01
+-7.7200699E+01 3.5401165E+01-7.7218002E+01 3.5401737E+01
+-7.7221832E+01 3.5396969E+01-7.7228149E+01 3.5399403E+01
+-7.7231926E+01 3.5393272E+01-7.7237709E+01 3.5391380E+01
+-7.7235573E+01 3.5384235E+01-7.7240547E+01 3.5382347E+01
+-7.7236214E+01 3.5379578E+01-7.7237968E+01 3.5361572E+01
+-7.7256767E+01 3.5350170E+01-7.7268250E+01 3.5354725E+01
+-7.7270844E+01 3.5359646E+01-7.7268517E+01 3.5365318E+01
+-7.7270752E+01 3.5369717E+01-7.7279854E+01 3.5375443E+01
+-7.7295990E+01 3.5379204E+01-7.7354294E+01 3.5327827E+01
+-7.7365799E+01 3.5333488E+01-7.7381409E+01 3.5334290E+01
+-7.7391281E+01 3.5339886E+01
+ 215 160 154 126 62 1 19
+-7.6549194E+01 3.5391922E+01-7.6529861E+01 3.5395432E+01
+-7.6473740E+01 3.5368767E+01-7.6448471E+01 3.5385609E+01
+-7.6428833E+01 3.5405251E+01-7.6397957E+01 3.5398235E+01
+-7.6367088E+01 3.5379997E+01-7.6322182E+01 3.5365963E+01
+-7.6285698E+01 3.5344913E+01-7.6263245E+01 3.5340706E+01
+-7.6222549E+01 3.5339298E+01-7.6153793E+01 3.5325268E+01
+-7.6110291E+01 3.5354736E+01-7.6068192E+01 3.5368767E+01
+-7.6020477E+01 3.5409466E+01-7.5993813E+01 3.5468399E+01
+-7.5911026E+01 3.5551193E+01-7.5882957E+01 3.5575047E+01
+-7.5867485E+01 3.5574020E+01
+ 216 42956 134 159 58 69 32
+-7.8708893E+01 3.5518925E+01-7.8689774E+01 3.5515949E+01
+-7.8686920E+01 3.5501659E+01-7.8676384E+01 3.5496410E+01
+-7.8660851E+01 3.5496044E+01-7.8653862E+01 3.5483795E+01
+-7.8650810E+01 3.5482605E+01-7.8650566E+01 3.5471775E+01
+-7.8639236E+01 3.5461632E+01-7.8627464E+01 3.5457848E+01
+-7.8619949E+01 3.5445171E+01-7.8614944E+01 3.5441994E+01
+-7.8613853E+01 3.5434914E+01-7.8607262E+01 3.5432178E+01
+-7.8609795E+01 3.5426933E+01-7.8599518E+01 3.5418194E+01
+-7.8597450E+01 3.5406200E+01-7.8592865E+01 3.5398304E+01
+-7.8575943E+01 3.5390018E+01-7.8572006E+01 3.5384872E+01
+-7.8569344E+01 3.5370426E+01-7.8567162E+01 3.5367107E+01
+-7.8563339E+01 3.5366653E+01-7.8562553E+01 3.5361046E+01
+-7.8550957E+01 3.5355892E+01-7.8549370E+01 3.5352959E+01
+-7.8541656E+01 3.5351128E+01-7.8533096E+01 3.5342461E+01
+-7.8530487E+01 3.5334644E+01-7.8536438E+01 3.5326038E+01
+-7.8536194E+01 3.5319221E+01-7.8541672E+01 3.5315102E+01
+ 217 35161 160 133 65 69 2
+-7.9183556E+01 3.5306820E+01-7.8970894E+01 3.5522087E+01
+ 218 35229 137 160 65 73 32
+-7.9350357E+01 3.5517841E+01-7.9351624E+01 3.5513672E+01
+-7.9341286E+01 3.5506187E+01-7.9336182E+01 3.5497871E+01
+-7.9339211E+01 3.5492374E+01-7.9345810E+01 3.5488369E+01
+-7.9352104E+01 3.5477467E+01-7.9360245E+01 3.5477394E+01
+-7.9356941E+01 3.5473824E+01-7.9360077E+01 3.5469540E+01
+-7.9355965E+01 3.5469521E+01-7.9355431E+01 3.5464806E+01
+-7.9348747E+01 3.5463432E+01-7.9350861E+01 3.5457981E+01
+-7.9346413E+01 3.5457111E+01-7.9342125E+01 3.5448711E+01
+-7.9329201E+01 3.5439121E+01-7.9327126E+01 3.5433144E+01
+-7.9329819E+01 3.5431038E+01-7.9330009E+01 3.5423412E+01
+-7.9317787E+01 3.5419907E+01-7.9311943E+01 3.5409813E+01
+-7.9305458E+01 3.5407063E+01-7.9304749E+01 3.5404591E+01
+-7.9293686E+01 3.5399342E+01-7.9289825E+01 3.5400215E+01
+-7.9272133E+01 3.5362354E+01-7.9273788E+01 3.5352352E+01
+-7.9266144E+01 3.5345432E+01-7.9254608E+01 3.5343128E+01
+-7.9222145E+01 3.5324261E+01-7.9183556E+01 3.5306820E+01
+ 219 29841 146 161 78 1 33
+-8.3961151E+01 3.5463657E+01-8.3961281E+01 3.5459675E+01
+-8.3965744E+01 3.5456165E+01-8.3964485E+01 3.5454124E+01
+-8.3971870E+01 3.5454697E+01-8.3972260E+01 3.5447281E+01
+-8.3979919E+01 3.5448124E+01-8.3983803E+01 3.5440411E+01
+-8.3991714E+01 3.5440456E+01-8.3994820E+01 3.5434849E+01
+-8.3999535E+01 3.5433769E+01-8.4000488E+01 3.5423244E+01
+-8.4014801E+01 3.5411900E+01-8.4023399E+01 3.5411400E+01
+-8.4018906E+01 3.5399700E+01-8.4014198E+01 3.5397701E+01
+-8.4012802E+01 3.5392200E+01-8.4008301E+01 3.5390301E+01
+-8.4011307E+01 3.5384300E+01-8.4007500E+01 3.5371559E+01
+-8.4023544E+01 3.5354137E+01-8.4032249E+01 3.5352695E+01
+-8.4038414E+01 3.5347733E+01-8.4034149E+01 3.5343243E+01
+-8.4036285E+01 3.5337593E+01-8.4031357E+01 3.5336357E+01
+-8.4029472E+01 3.5333115E+01-8.4034599E+01 3.5322300E+01
+-8.4035797E+01 3.5312801E+01-8.4026604E+01 3.5309200E+01
+-8.4021507E+01 3.5301300E+01-8.4023598E+01 3.5295700E+01
+-8.4029198E+01 3.5292099E+01
+ 220 31848 162 149 59 80 31
+-8.2920967E+01 3.5291763E+01-8.2917358E+01 3.5291916E+01
+-8.2914902E+01 3.5297215E+01-8.2902847E+01 3.5305241E+01
+-8.2885429E+01 3.5307877E+01-8.2876694E+01 3.5314472E+01
+-8.2871277E+01 3.5312248E+01-8.2867630E+01 3.5315842E+01
+-8.2861237E+01 3.5314453E+01-8.2858429E+01 3.5316982E+01
+-8.2846565E+01 3.5318707E+01-8.2831665E+01 3.5318676E+01
+-8.2828560E+01 3.5323460E+01-8.2824928E+01 3.5324188E+01
+-8.2822853E+01 3.5331757E+01-8.2816467E+01 3.5334057E+01
+-8.2813293E+01 3.5339172E+01-8.2814941E+01 3.5344173E+01
+-8.2805016E+01 3.5348125E+01-8.2795593E+01 3.5364845E+01
+-8.2791885E+01 3.5366779E+01-8.2788094E+01 3.5380833E+01
+-8.2782898E+01 3.5382950E+01-8.2782211E+01 3.5386654E+01
+-8.2777939E+01 3.5388363E+01-8.2774826E+01 3.5393360E+01
+-8.2764297E+01 3.5396912E+01-8.2750687E+01 3.5406445E+01
+-8.2746117E+01 3.5407001E+01-8.2749611E+01 3.5412952E+01
+-8.2745361E+01 3.5422817E+01
+ 221 43199 162 136 71 59 41
+-8.2920967E+01 3.5291763E+01-8.2927612E+01 3.5302910E+01
+-8.2932953E+01 3.5305424E+01-8.2935654E+01 3.5303829E+01
+-8.2949944E+01 3.5306320E+01-8.2951378E+01 3.5312824E+01
+-8.2954720E+01 3.5313618E+01-8.2955139E+01 3.5316158E+01
+-8.2964958E+01 3.5315079E+01-8.2964798E+01 3.5332993E+01
+-8.2971741E+01 3.5342667E+01-8.2977753E+01 3.5343334E+01
+-8.2977287E+01 3.5350655E+01-8.2986496E+01 3.5355999E+01
+-8.2990486E+01 3.5367538E+01-8.3007370E+01 3.5377224E+01
+-8.3023117E+01 3.5379086E+01-8.3030266E+01 3.5387070E+01
+-8.3044090E+01 3.5394295E+01-8.3045074E+01 3.5415333E+01
+-8.3055893E+01 3.5425392E+01-8.3065369E+01 3.5426315E+01
+-8.3080132E+01 3.5434265E+01-8.3079880E+01 3.5447796E+01
+-8.3090042E+01 3.5448200E+01-8.3092705E+01 3.5457539E+01
+-8.3108955E+01 3.5463730E+01-8.3122345E+01 3.5465485E+01
+-8.3132080E+01 3.5463013E+01-8.3137741E+01 3.5464046E+01
+-8.3136505E+01 3.5479137E+01-8.3140526E+01 3.5484577E+01
+-8.3137817E+01 3.5488945E+01-8.3139008E+01 3.5491295E+01
+-8.3158081E+01 3.5495918E+01-8.3164001E+01 3.5509052E+01
+-8.3174538E+01 3.5508400E+01-8.3179802E+01 3.5510300E+01
+-8.3188339E+01 3.5507965E+01-8.3188873E+01 3.5511787E+01
+-8.3195366E+01 3.5518150E+01
+ 222 44227 163 122 58 67 31
+-7.8304947E+01 3.5285931E+01-7.8287872E+01 3.5314884E+01
+-7.8273270E+01 3.5319122E+01-7.8267822E+01 3.5324821E+01
+-7.8258102E+01 3.5325390E+01-7.8249153E+01 3.5320377E+01
+-7.8242615E+01 3.5320290E+01-7.8216660E+01 3.5333363E+01
+-7.8218475E+01 3.5338741E+01-7.8216751E+01 3.5340767E+01
+-7.8212189E+01 3.5342060E+01-7.8210266E+01 3.5339890E+01
+-7.8198090E+01 3.5340092E+01-7.8197327E+01 3.5343571E+01
+-7.8187553E+01 3.5342361E+01-7.8184959E+01 3.5345085E+01
+-7.8179649E+01 3.5343731E+01-7.8175430E+01 3.5346775E+01
+-7.8165741E+01 3.5346291E+01-7.8161018E+01 3.5349335E+01
+-7.8158928E+01 3.5347481E+01-7.8153671E+01 3.5350246E+01
+-7.8154289E+01 3.5356129E+01-7.8160347E+01 3.5356335E+01
+-7.8158302E+01 3.5359951E+01-7.8162575E+01 3.5367596E+01
+-7.8144661E+01 3.5386662E+01-7.8150452E+01 3.5391418E+01
+-7.8154297E+01 3.5391739E+01-7.8155174E+01 3.5417469E+01
+-7.8064888E+01 3.5585258E+01
+ 223 44026 164 158 63 85 23
+-8.3680054E+01 3.5279453E+01-8.3672569E+01 3.5282410E+01
+-8.3495560E+01 3.5299526E+01-8.3490952E+01 3.5305191E+01
+-8.3486435E+01 3.5305328E+01-8.3474609E+01 3.5297726E+01
+-8.3467178E+01 3.5297569E+01-8.3455811E+01 3.5302879E+01
+-8.3452599E+01 3.5312794E+01-8.3447701E+01 3.5316860E+01
+-8.3440025E+01 3.5317608E+01-8.3432732E+01 3.5325127E+01
+-8.3428764E+01 3.5324577E+01-8.3421684E+01 3.5317593E+01
+-8.3415771E+01 3.5319340E+01-8.3411201E+01 3.5316833E+01
+-8.3399666E+01 3.5327843E+01-8.3379128E+01 3.5325554E+01
+-8.3372658E+01 3.5329044E+01-8.3364189E+01 3.5325970E+01
+-8.3357277E+01 3.5329430E+01-8.3347794E+01 3.5328377E+01
+-8.3339828E+01 3.5330910E+01
+ 224 41289 164 147 78 63 53
+-8.3680054E+01 3.5279453E+01-8.3686363E+01 3.5290100E+01
+-8.3695358E+01 3.5297562E+01-8.3689949E+01 3.5318024E+01
+-8.3678589E+01 3.5328403E+01-8.3670395E+01 3.5328701E+01
+-8.3659943E+01 3.5335506E+01-8.3643318E+01 3.5339417E+01
+-8.3639717E+01 3.5338547E+01-8.3620911E+01 3.5345123E+01
+-8.3617149E+01 3.5349258E+01-8.3613800E+01 3.5357258E+01
+-8.3593285E+01 3.5376842E+01-8.3595398E+01 3.5380951E+01
+-8.3582420E+01 3.5409264E+01-8.3585068E+01 3.5418015E+01
+-8.3589119E+01 3.5418953E+01-8.3585670E+01 3.5424721E+01
+-8.3585655E+01 3.5434776E+01-8.3610001E+01 3.5426861E+01
+-8.3617607E+01 3.5435509E+01-8.3641457E+01 3.5443562E+01
+-8.3644409E+01 3.5442066E+01-8.3646233E+01 3.5428791E+01
+-8.3651680E+01 3.5426323E+01-8.3657875E+01 3.5432159E+01
+-8.3664734E+01 3.5431038E+01-8.3668610E+01 3.5435181E+01
+-8.3703209E+01 3.5443104E+01-8.3717262E+01 3.5442268E+01
+-8.3734070E+01 3.5447182E+01-8.3750000E+01 3.5442368E+01
+-8.3763016E+01 3.5442394E+01-8.3776527E+01 3.5443771E+01
+-8.3801773E+01 3.5455765E+01-8.3804680E+01 3.5454098E+01
+-8.3808281E+01 3.5443890E+01-8.3816025E+01 3.5446224E+01
+-8.3819443E+01 3.5450230E+01-8.3831749E+01 3.5450897E+01
+-8.3837166E+01 3.5448547E+01-8.3844681E+01 3.5453083E+01
+-8.3865822E+01 3.5448074E+01-8.3868156E+01 3.5455112E+01
+-8.3875000E+01 3.5460812E+01-8.3884567E+01 3.5463253E+01
+-8.3896202E+01 3.5461678E+01-8.3908554E+01 3.5466473E+01
+-8.3914932E+01 3.5464256E+01-8.3928055E+01 3.5450516E+01
+-8.3937088E+01 3.5448345E+01-8.3945847E+01 3.5451591E+01
+-8.3952972E+01 3.5460552E+01
+ 225 44291 159 163 58 86 5
+-7.8541672E+01 3.5315102E+01-7.8491714E+01 3.5263229E+01
+-7.8410629E+01 3.5256210E+01-7.8364067E+01 3.5270950E+01
+-7.8304947E+01 3.5285931E+01
+ 226 30754 165 151 82 61 3
+-7.6896019E+01 3.5253464E+01-7.6959763E+01 3.5300907E+01
+-7.7190742E+01 3.5418793E+01
+ 227 35430 166 164 78 85 2
+-8.3702675E+01 3.5248493E+01-8.3680054E+01 3.5279453E+01
+ 228 36598 159 167 86 69 15
+-7.8541672E+01 3.5315102E+01-7.8548538E+01 3.5310799E+01
+-7.8555740E+01 3.5309448E+01-7.8559990E+01 3.5306244E+01
+-7.8558235E+01 3.5304413E+01-7.8570709E+01 3.5301762E+01
+-7.8575813E+01 3.5296082E+01-7.8583244E+01 3.5297249E+01
+-7.8585426E+01 3.5293358E+01-7.8583611E+01 3.5291111E+01
+-7.8585052E+01 3.5273102E+01-7.8598892E+01 3.5264603E+01
+-7.8600174E+01 3.5258629E+01-7.8609352E+01 3.5254002E+01
+-7.8617462E+01 3.5245556E+01
+ 229 36143 156 168 82 79 22
+-7.7391281E+01 3.5339886E+01-7.7395515E+01 3.5343475E+01
+-7.7410675E+01 3.5339043E+01-7.7410126E+01 3.5331585E+01
+-7.7414429E+01 3.5333553E+01-7.7414825E+01 3.5330528E+01
+-7.7431946E+01 3.5329205E+01-7.7431686E+01 3.5312950E+01
+-7.7438477E+01 3.5311901E+01-7.7440544E+01 3.5303932E+01
+-7.7448608E+01 3.5302101E+01-7.7449951E+01 3.5299767E+01
+-7.7446747E+01 3.5293587E+01-7.7440285E+01 3.5289719E+01
+-7.7437752E+01 3.5276764E+01-7.7429474E+01 3.5270866E+01
+-7.7425980E+01 3.5258793E+01-7.7434105E+01 3.5249512E+01
+-7.7464478E+01 3.5238831E+01-7.7465790E+01 3.5234737E+01
+-7.7473488E+01 3.5230816E+01-7.7474113E+01 3.5228455E+01
+ 230 35403 166 161 87 78 44
+-8.3702675E+01 3.5248493E+01-8.3708603E+01 3.5257496E+01
+-8.3722786E+01 3.5252872E+01-8.3734360E+01 3.5244919E+01
+-8.3756966E+01 3.5242424E+01-8.3762184E+01 3.5247967E+01
+-8.3773598E+01 3.5245670E+01-8.3781891E+01 3.5251953E+01
+-8.3787949E+01 3.5252804E+01-8.3795334E+01 3.5257305E+01
+-8.3806953E+01 3.5252579E+01-8.3813477E+01 3.5254597E+01
+-8.3822594E+01 3.5250107E+01-8.3830711E+01 3.5255825E+01
+-8.3844810E+01 3.5255322E+01-8.3851379E+01 3.5249081E+01
+-8.3864876E+01 3.5247334E+01-8.3869507E+01 3.5243229E+01
+-8.3873970E+01 3.5243912E+01-8.3879944E+01 3.5238213E+01
+-8.3888229E+01 3.5234715E+01-8.3893661E+01 3.5233196E+01
+-8.3901352E+01 3.5238461E+01-8.3907066E+01 3.5233524E+01
+-8.3925301E+01 3.5228130E+01-8.3934395E+01 3.5222908E+01
+-8.3943741E+01 3.5222481E+01-8.3944283E+01 3.5219841E+01
+-8.3957497E+01 3.5220284E+01-8.3958893E+01 3.5216843E+01
+-8.3968262E+01 3.5217957E+01-8.3976181E+01 3.5221153E+01
+-8.3977646E+01 3.5225479E+01-8.3983658E+01 3.5229488E+01
+-8.4002159E+01 3.5233620E+01-8.4006638E+01 3.5241718E+01
+-8.4001144E+01 3.5248592E+01-8.4001801E+01 3.5252602E+01
+-8.4005707E+01 3.5252899E+01-8.4011101E+01 3.5257198E+01
+-8.4009598E+01 3.5272900E+01-8.4016502E+01 3.5276001E+01
+-8.4022705E+01 3.5287102E+01-8.4029198E+01 3.5292099E+01
+ 231 30857 165 157 61 84 9
+-7.6896019E+01 3.5253464E+01-7.6845802E+01 3.5215881E+01
+-7.6632889E+01 3.5235065E+01-7.6614197E+01 3.5270775E+01
+-7.6612518E+01 3.5279243E+01-7.6619713E+01 3.5302116E+01
+-7.6616585E+01 3.5314510E+01-7.6617386E+01 3.5330704E+01
+-7.6611359E+01 3.5334160E+01
+ 232 33170 141 169 75 72 11
+-8.0784279E+01 3.5506962E+01-8.0786736E+01 3.5492413E+01
+-8.0752525E+01 3.5414330E+01-8.0763565E+01 3.5412235E+01
+-8.0766495E+01 3.5401348E+01-8.0755493E+01 3.5394787E+01
+-8.0744392E+01 3.5380623E+01-8.0736320E+01 3.5374462E+01
+-8.0693802E+01 3.5346375E+01-8.0666817E+01 3.5267376E+01
+-8.0550491E+01 3.5208263E+01
+ 233 34753 170 161 1 87 35
+-8.4292397E+01 3.5206600E+01-8.4290321E+01 3.5225494E+01
+-8.4288002E+01 3.5224400E+01-8.4283302E+01 3.5226501E+01
+-8.4275505E+01 3.5234699E+01-8.4260399E+01 3.5241798E+01
+-8.4253304E+01 3.5249401E+01-8.4242798E+01 3.5252998E+01
+-8.4232201E+01 3.5264500E+01-8.4223801E+01 3.5269001E+01
+-8.4211105E+01 3.5265400E+01-8.4202904E+01 3.5255600E+01
+-8.4200203E+01 3.5244598E+01-8.4193199E+01 3.5244701E+01
+-8.4188507E+01 3.5239899E+01-8.4178596E+01 3.5240601E+01
+-8.4169998E+01 3.5246300E+01-8.4161507E+01 3.5243401E+01
+-8.4155403E+01 3.5246399E+01-8.4138603E+01 3.5245399E+01
+-8.4127197E+01 3.5240898E+01-8.4125397E+01 3.5249802E+01
+-8.4119705E+01 3.5252201E+01-8.4114197E+01 3.5248901E+01
+-8.4106781E+01 3.5251427E+01-8.4102364E+01 3.5248035E+01
+-8.4095230E+01 3.5248302E+01-8.4082603E+01 3.5256001E+01
+-8.4081207E+01 3.5261063E+01-8.4052704E+01 3.5269901E+01
+-8.4051598E+01 3.5273102E+01-8.4046600E+01 3.5274101E+01
+-8.4040703E+01 3.5279400E+01-8.4036102E+01 3.5288601E+01
+-8.4029198E+01 3.5292099E+01
+ 234 36460 174 167 69 88 44
+-7.9096382E+01 3.5192020E+01-7.9000000E+01 3.5213764E+01
+-7.8977501E+01 3.5211681E+01-7.8941315E+01 3.5218975E+01
+-7.8935265E+01 3.5218399E+01-7.8924736E+01 3.5223488E+01
+-7.8920067E+01 3.5219967E+01-7.8898483E+01 3.5230656E+01
+-7.8893265E+01 3.5228226E+01-7.8878830E+01 3.5231201E+01
+-7.8874336E+01 3.5235905E+01-7.8876961E+01 3.5240814E+01
+-7.8870575E+01 3.5244225E+01-7.8859901E+01 3.5242462E+01
+-7.8854782E+01 3.5248192E+01-7.8848534E+01 3.5250000E+01
+-7.8847717E+01 3.5252762E+01-7.8834969E+01 3.5252327E+01
+-7.8824951E+01 3.5259563E+01-7.8816772E+01 3.5260185E+01
+-7.8806305E+01 3.5256588E+01-7.8802704E+01 3.5262127E+01
+-7.8798859E+01 3.5262058E+01-7.8794777E+01 3.5265884E+01
+-7.8782555E+01 3.5263386E+01-7.8782112E+01 3.5260708E+01
+-7.8778671E+01 3.5263290E+01-7.8771584E+01 3.5261890E+01
+-7.8766289E+01 3.5257999E+01-7.8760612E+01 3.5263836E+01
+-7.8759583E+01 3.5261456E+01-7.8754868E+01 3.5263283E+01
+-7.8754616E+01 3.5259506E+01-7.8750511E+01 3.5263348E+01
+-7.8741203E+01 3.5263725E+01-7.8736092E+01 3.5261757E+01
+-7.8725937E+01 3.5266777E+01-7.8720940E+01 3.5264988E+01
+-7.8719063E+01 3.5259956E+01-7.8713707E+01 3.5259567E+01
+-7.8712280E+01 3.5257526E+01-7.8707962E+01 3.5259064E+01
+-7.8705223E+01 3.5256866E+01-7.8617462E+01 3.5245556E+01
+ 235 36537 160 174 69 73 15
+-7.9183556E+01 3.5306820E+01-7.9223328E+01 3.5267971E+01
+-7.9202744E+01 3.5258137E+01-7.9192833E+01 3.5249519E+01
+-7.9186295E+01 3.5247185E+01-7.9179398E+01 3.5248009E+01
+-7.9165329E+01 3.5240921E+01-7.9154152E+01 3.5229202E+01
+-7.9154610E+01 3.5220276E+01-7.9150673E+01 3.5213108E+01
+-7.9138145E+01 3.5211246E+01-7.9135277E+01 3.5206738E+01
+-7.9120857E+01 3.5204903E+01-7.9101494E+01 3.5196602E+01
+-7.9096382E+01 3.5192020E+01
+ 236 32093 175 153 77 83 23
+-8.2353775E+01 3.5190712E+01-8.2350967E+01 3.5228191E+01
+-8.2359596E+01 3.5228271E+01-8.2359131E+01 3.5244522E+01
+-8.2349586E+01 3.5244209E+01-8.2346062E+01 3.5286415E+01
+-8.2330513E+01 3.5302628E+01-8.2329704E+01 3.5307667E+01
+-8.2326591E+01 3.5309151E+01-8.2318283E+01 3.5306595E+01
+-8.2314293E+01 3.5312935E+01-8.2310600E+01 3.5314335E+01
+-8.2311234E+01 3.5320057E+01-8.2305695E+01 3.5326721E+01
+-8.2305283E+01 3.5332439E+01-8.2297836E+01 3.5336437E+01
+-8.2289993E+01 3.5353775E+01-8.2282120E+01 3.5360706E+01
+-8.2279785E+01 3.5365318E+01-8.2281281E+01 3.5367779E+01
+-8.2275070E+01 3.5376541E+01-8.2263649E+01 3.5385757E+01
+-8.2261627E+01 3.5392868E+01
+ 237 38361 163 176 67 86 4
+-7.8304947E+01 3.5285931E+01-7.8246841E+01 3.5226025E+01
+-7.8161995E+01 3.5204151E+01-7.8163826E+01 3.5189209E+01
+ 238 32254 153 177 66 83 55
+-8.2261627E+01 3.5392868E+01-8.2249130E+01 3.5399929E+01
+-8.2239151E+01 3.5402351E+01-8.2228218E+01 3.5395672E+01
+-8.2220802E+01 3.5394577E+01-8.2214569E+01 3.5398052E+01
+-8.2209099E+01 3.5397644E+01-8.2205498E+01 3.5403515E+01
+-8.2198273E+01 3.5402630E+01-8.2193939E+01 3.5397133E+01
+-8.2190392E+01 3.5399193E+01-8.2184982E+01 3.5396389E+01
+-8.2181206E+01 3.5402557E+01-8.2173317E+01 3.5405319E+01
+-8.2171532E+01 3.5409004E+01-8.2167358E+01 3.5407631E+01
+-8.2159782E+01 3.5409004E+01-8.2151169E+01 3.5406940E+01
+-8.2141663E+01 3.5399036E+01-8.2131943E+01 3.5395565E+01
+-8.2129135E+01 3.5396603E+01-8.2122398E+01 3.5392708E+01
+-8.2119629E+01 3.5387695E+01-8.2115433E+01 3.5387150E+01
+-8.2107491E+01 3.5380760E+01-8.2104652E+01 3.5368088E+01
+-8.2100662E+01 3.5371323E+01-8.2097763E+01 3.5369991E+01
+-8.2087769E+01 3.5354927E+01-8.2079971E+01 3.5352909E+01
+-8.2077988E+01 3.5342628E+01-8.2071754E+01 3.5338627E+01
+-8.2067802E+01 3.5339043E+01-8.2064949E+01 3.5334591E+01
+-8.2055122E+01 3.5336170E+01-8.2050957E+01 3.5328590E+01
+-8.2046913E+01 3.5327011E+01-8.2046295E+01 3.5320877E+01
+-8.2030907E+01 3.5308575E+01-8.2028694E+01 3.5300880E+01
+-8.2022720E+01 3.5297874E+01-8.2016350E+01 3.5298634E+01
+-8.2014709E+01 3.5291920E+01-8.2006447E+01 3.5284359E+01
+-8.2000000E+01 3.5281883E+01-8.1994965E+01 3.5269653E+01
+-8.1983849E+01 3.5264324E+01-8.1978432E+01 3.5264416E+01
+-8.1969025E+01 3.5257362E+01-8.1967758E+01 3.5249573E+01
+-8.1961426E+01 3.5248295E+01-8.1966560E+01 3.5242867E+01
+-8.1965340E+01 3.5222961E+01-8.1970901E+01 3.5211674E+01
+-8.1969498E+01 3.5187168E+01
+ 239 47680 173 177 83 1 2
+-8.2216385E+01 3.5195930E+01-8.1969498E+01 3.5187168E+01
+ 240 161 178 171 60 1 44
+-7.5750946E+01 3.5187092E+01-7.5739799E+01 3.5189495E+01
+-7.5656326E+01 3.5218391E+01-7.5616196E+01 3.5229630E+01
+-7.5595329E+01 3.5232841E+01-7.5568840E+01 3.5235249E+01
+-7.5545563E+01 3.5228024E+01-7.5534325E+01 3.5215984E+01
+-7.5523888E+01 3.5235249E+01-7.5511047E+01 3.5299461E+01
+-7.5486168E+01 3.5395775E+01-7.5479744E+01 3.5478447E+01
+-7.5462090E+01 3.5553902E+01-7.5461288E+01 3.5593227E+01
+-7.5482155E+01 3.5687939E+01-7.5489021E+01 3.5708405E+01
+-7.5504623E+01 3.5747337E+01-7.5523888E+01 3.5774628E+01
+-7.5532722E+01 3.5774628E+01-7.5514259E+01 3.5718441E+01
+-7.5506233E+01 3.5683929E+01-7.5488579E+01 3.5644600E+01
+-7.5480545E+01 3.5632561E+01-7.5474129E+01 3.5593227E+01
+-7.5477333E+01 3.5562729E+01-7.5489372E+01 3.5509750E+01
+-7.5486969E+01 3.5500118E+01-7.5488579E+01 3.5455975E+01
+-7.5494194E+01 3.5412632E+01-7.5501419E+01 3.5374908E+01
+-7.5511848E+01 3.5362869E+01-7.5518272E+01 3.5330765E+01
+-7.5519882E+01 3.5288219E+01-7.5523888E+01 3.5279392E+01
+-7.5539146E+01 3.5272972E+01-7.5568039E+01 3.5265747E+01
+-7.5592110E+01 3.5264145E+01-7.5646698E+01 3.5229630E+01
+-7.5673187E+01 3.5220798E+01-7.5680405E+01 3.5226418E+01
+-7.5682014E+01 3.5233639E+01-7.5708496E+01 3.5211166E+01
+-7.5752647E+01 3.5196720E+01-7.5753769E+01 3.5196533E+01
+ 241 34361 178 171 93 60 2
+-7.5750946E+01 3.5187092E+01-7.5753769E+01 3.5196533E+01
+ 242 33418 179 144 75 76 7
+-8.0505447E+01 3.5185280E+01-8.0505638E+01 3.5194397E+01
+-8.0499329E+01 3.5198338E+01-8.0492699E+01 3.5207478E+01
+-8.0483765E+01 3.5212471E+01-8.0484009E+01 3.5215508E+01
+-8.0295616E+01 3.5502964E+01
+ 243 33281 169 179 75 92 2
+-8.0550491E+01 3.5208263E+01-8.0505447E+01 3.5185280E+01
+ 244 47680 175 173 83 1 9
+-8.2353775E+01 3.5190712E+01-8.2344711E+01 3.5193001E+01
+-8.2339668E+01 3.5188816E+01-8.2333138E+01 3.5190533E+01
+-8.2330711E+01 3.5186653E+01-8.2323509E+01 3.5184677E+01
+-8.2315025E+01 3.5190975E+01-8.2282677E+01 3.5199745E+01
+-8.2216385E+01 3.5195930E+01
+ 245 35898 177 180 66 1 2
+-8.1969498E+01 3.5187168E+01-8.1874611E+01 3.5183990E+01
+ 246 33057 124 181 68 66 6
+-8.1692513E+01 3.5579659E+01-8.1694862E+01 3.5486118E+01
+-8.1700027E+01 3.5438435E+01-8.1703033E+01 3.5357067E+01
+-8.1759750E+01 3.5222298E+01-8.1768242E+01 3.5180370E+01
+ 247 35898 180 181 66 1 2
+-8.1874611E+01 3.5183990E+01-8.1768242E+01 3.5180370E+01
+ 248 41512 155 182 79 67 4
+-7.7806023E+01 3.5369659E+01-7.7817787E+01 3.5358356E+01
+-7.7824707E+01 3.5343800E+01-7.7834549E+01 3.5177650E+01
+ 249 36539 174 183 88 73 4
+-7.9096382E+01 3.5192020E+01-7.9098946E+01 3.5183857E+01
+-7.9096642E+01 3.5177521E+01-7.9097984E+01 3.5173855E+01
+ 250 35617 181 184 68 1 2
+-8.1768242E+01 3.5180370E+01-8.1366890E+01 3.5164761E+01
+ 251 46080 185 139 74 73 23
+-7.9614532E+01 3.5163551E+01-7.9620781E+01 3.5170948E+01
+-7.9626534E+01 3.5170280E+01-7.9628906E+01 3.5175018E+01
+-7.9637573E+01 3.5175941E+01-7.9647781E+01 3.5186985E+01
+-7.9657211E+01 3.5192986E+01-7.9661942E+01 3.5204849E+01
+-7.9660049E+01 3.5209427E+01-7.9664558E+01 3.5217651E+01
+-7.9664032E+01 3.5225410E+01-7.9668663E+01 3.5231342E+01
+-7.9672371E+01 3.5244423E+01-7.9685349E+01 3.5247307E+01
+-7.9688614E+01 3.5250298E+01-7.9698280E+01 3.5251305E+01
+-7.9705345E+01 3.5262020E+01-7.9705421E+01 3.5268066E+01
+-7.9712074E+01 3.5275188E+01-7.9710052E+01 3.5301121E+01
+-7.9754379E+01 3.5451885E+01-7.9767883E+01 3.5480305E+01
+-7.9774185E+01 3.5511337E+01
+ 252 35559 186 150 68 81 11
+-8.1328194E+01 3.5163322E+01-8.1323189E+01 3.5191879E+01
+-8.1324341E+01 3.5241356E+01-8.1321465E+01 3.5260323E+01
+-8.1355453E+01 3.5279392E+01-8.1355553E+01 3.5295971E+01
+-8.1366959E+01 3.5314705E+01-8.1364090E+01 3.5323360E+01
+-8.1356903E+01 3.5330555E+01-8.1399033E+01 3.5352982E+01
+-8.1456696E+01 3.5419483E+01
+ 253 35617 184 186 68 1 2
+-8.1366890E+01 3.5164761E+01-8.1328194E+01 3.5163322E+01
+ 254 30348 179 172 76 92 33
+-8.0505447E+01 3.5185280E+01-8.0503754E+01 3.5181641E+01
+-8.0488876E+01 3.5175434E+01-8.0482803E+01 3.5180134E+01
+-8.0478760E+01 3.5179218E+01-8.0476799E+01 3.5172398E+01
+-8.0469711E+01 3.5166901E+01-8.0463913E+01 3.5170269E+01
+-8.0458557E+01 3.5164795E+01-8.0447540E+01 3.5164822E+01
+-8.0440094E+01 3.5161175E+01-8.0420380E+01 3.5172562E+01
+-8.0417137E+01 3.5171486E+01-8.0411896E+01 3.5163395E+01
+-8.0401131E+01 3.5167355E+01-8.0389526E+01 3.5165634E+01
+-8.0376747E+01 3.5177559E+01-8.0371193E+01 3.5179760E+01
+-8.0360359E+01 3.5166553E+01-8.0355537E+01 3.5165432E+01
+-8.0351799E+01 3.5169212E+01-8.0346474E+01 3.5169075E+01
+-8.0340805E+01 3.5173840E+01-8.0335846E+01 3.5173611E+01
+-8.0330132E+01 3.5176567E+01-8.0321594E+01 3.5172787E+01
+-8.0320312E+01 3.5179111E+01-8.0305977E+01 3.5181976E+01
+-8.0303932E+01 3.5188206E+01-8.0295845E+01 3.5194180E+01
+-8.0287315E+01 3.5191502E+01-8.0281502E+01 3.5195847E+01
+-8.0277428E+01 3.5195992E+01
+ 255 35404 187 166 87 85 15
+-8.3738213E+01 3.5155819E+01-8.3730927E+01 3.5171291E+01
+-8.3731422E+01 3.5178726E+01-8.3712006E+01 3.5190521E+01
+-8.3711433E+01 3.5195763E+01-8.3716339E+01 3.5199661E+01
+-8.3719559E+01 3.5196724E+01-8.3729042E+01 3.5200520E+01
+-8.3722862E+01 3.5209358E+01-8.3712997E+01 3.5213200E+01
+-8.3709801E+01 3.5218952E+01-8.3697739E+01 3.5224487E+01
+-8.3690536E+01 3.5234753E+01-8.3691803E+01 3.5242706E+01
+-8.3702675E+01 3.5248493E+01
+ 256 40943 186 188 81 1 3
+-8.1328194E+01 3.5163322E+01-8.1114441E+01 3.5154228E+01
+-8.1033401E+01 3.5148544E+01
+ 257 40730 188 152 81 72 37
+-8.1033401E+01 3.5148544E+01-8.1024208E+01 3.5148281E+01
+-8.1018311E+01 3.5153801E+01-8.1010269E+01 3.5153324E+01
+-8.1006058E+01 3.5156422E+01-8.1006889E+01 3.5164505E+01
+-8.1002762E+01 3.5172112E+01-8.1002167E+01 3.5184032E+01
+-8.1006447E+01 3.5195152E+01-8.1005569E+01 3.5208065E+01
+-8.1014671E+01 3.5221870E+01-8.1008224E+01 3.5247936E+01
+-8.1014221E+01 3.5258175E+01-8.1015266E+01 3.5269054E+01
+-8.1001617E+01 3.5304382E+01-8.0981667E+01 3.5327412E+01
+-8.0985168E+01 3.5339809E+01-8.0975082E+01 3.5344742E+01
+-8.0971794E+01 3.5350937E+01-8.0968224E+01 3.5351028E+01
+-8.0962479E+01 3.5346916E+01-8.0955750E+01 3.5350342E+01
+-8.0943123E+01 3.5350559E+01-8.0934135E+01 3.5356949E+01
+-8.0923149E+01 3.5359940E+01-8.0926910E+01 3.5362350E+01
+-8.0936958E+01 3.5362076E+01-8.0951141E+01 3.5366741E+01
+-8.0960159E+01 3.5375214E+01-8.0962830E+01 3.5375095E+01
+-8.0968063E+01 3.5367802E+01-8.0974808E+01 3.5364166E+01
+-8.0983765E+01 3.5367950E+01-8.0986145E+01 3.5380482E+01
+-8.0977974E+01 3.5382008E+01-8.0956673E+01 3.5391632E+01
+-8.0955589E+01 3.5400696E+01
+ 258 38333 182 176 94 67 21
+-7.7834549E+01 3.5177650E+01-7.7889099E+01 3.5159931E+01
+-7.7894501E+01 3.5154194E+01-7.7893120E+01 3.5146156E+01
+-7.7909828E+01 3.5157215E+01-7.7910049E+01 3.5161655E+01
+-7.7913895E+01 3.5165981E+01-7.7926239E+01 3.5172665E+01
+-7.7937386E+01 3.5170902E+01-7.7945274E+01 3.5172230E+01
+-7.7954269E+01 3.5165340E+01-7.7970596E+01 3.5165771E+01
+-7.7978912E+01 3.5170418E+01-7.7984573E+01 3.5183338E+01
+-7.7995026E+01 3.5183018E+01-7.8001572E+01 3.5188896E+01
+-7.8017677E+01 3.5190914E+01-7.8021080E+01 3.5193733E+01
+-7.8044685E+01 3.5192505E+01-7.8077660E+01 3.5174961E+01
+-7.8163826E+01 3.5189209E+01
+ 259 43464 189 175 77 1 50
+-8.2575066E+01 3.5145370E+01-8.2568420E+01 3.5145565E+01
+-8.2568054E+01 3.5148811E+01-8.2562767E+01 3.5152939E+01
+-8.2557922E+01 3.5150654E+01-8.2554001E+01 3.5152760E+01
+-8.2555824E+01 3.5159401E+01-8.2546532E+01 3.5163616E+01
+-8.2536903E+01 3.5159977E+01-8.2535858E+01 3.5154556E+01
+-8.2525719E+01 3.5156403E+01-8.2516495E+01 3.5163280E+01
+-8.2508072E+01 3.5162289E+01-8.2504738E+01 3.5165737E+01
+-8.2495865E+01 3.5161945E+01-8.2490921E+01 3.5169601E+01
+-8.2487411E+01 3.5169613E+01-8.2486809E+01 3.5174347E+01
+-8.2477913E+01 3.5175972E+01-8.2475105E+01 3.5173927E+01
+-8.2468155E+01 3.5174515E+01-8.2459747E+01 3.5178020E+01
+-8.2454468E+01 3.5177299E+01-8.2452209E+01 3.5173641E+01
+-8.2457588E+01 3.5167267E+01-8.2457291E+01 3.5163834E+01
+-8.2450623E+01 3.5166004E+01-8.2440285E+01 3.5165569E+01
+-8.2434830E+01 3.5168163E+01-8.2430931E+01 3.5177715E+01
+-8.2424469E+01 3.5181335E+01-8.2428162E+01 3.5183254E+01
+-8.2422279E+01 3.5195885E+01-8.2417763E+01 3.5200016E+01
+-8.2415283E+01 3.5199116E+01-8.2411461E+01 3.5202370E+01
+-8.2398689E+01 3.5206039E+01-8.2399582E+01 3.5209064E+01
+-8.2393089E+01 3.5215286E+01-8.2384193E+01 3.5210426E+01
+-8.2385330E+01 3.5206154E+01-8.2380692E+01 3.5202160E+01
+-8.2378555E+01 3.5195969E+01-8.2383041E+01 3.5194233E+01
+-8.2384102E+01 3.5190891E+01-8.2372215E+01 3.5180225E+01
+-8.2362251E+01 3.5186367E+01-8.2364464E+01 3.5187656E+01
+-8.2363152E+01 3.5190926E+01-8.2353775E+01 3.5190712E+01
+ 260 31893 149 189 77 80 15
+-8.2745361E+01 3.5422817E+01-8.2619774E+01 3.5303768E+01
+-8.2622162E+01 3.5302952E+01-8.2623367E+01 3.5295654E+01
+-8.2618576E+01 3.5288452E+01-8.2610367E+01 3.5288158E+01
+-8.2616409E+01 3.5260067E+01-8.2611511E+01 3.5261444E+01
+-8.2604370E+01 3.5258743E+01-8.2604080E+01 3.5221821E+01
+-8.2590775E+01 3.5161682E+01-8.2585838E+01 3.5158611E+01
+-8.2585312E+01 3.5151432E+01-8.2579193E+01 3.5149723E+01
+-8.2575066E+01 3.5145370E+01
+ 261 33433 190 143 76 74 35
+-8.0075607E+01 3.5142933E+01-8.0068977E+01 3.5154995E+01
+-8.0057083E+01 3.5163887E+01-8.0053520E+01 3.5178459E+01
+-8.0061028E+01 3.5189045E+01-8.0061966E+01 3.5200111E+01
+-8.0070015E+01 3.5218166E+01-8.0078255E+01 3.5228569E+01
+-8.0091690E+01 3.5236660E+01-8.0098633E+01 3.5257942E+01
+-8.0092461E+01 3.5271843E+01-8.0093109E+01 3.5290077E+01
+-8.0079758E+01 3.5310963E+01-8.0082161E+01 3.5321316E+01
+-8.0066559E+01 3.5340508E+01-8.0065613E+01 3.5360332E+01
+-8.0054359E+01 3.5365822E+01-8.0051445E+01 3.5371395E+01
+-8.0066360E+01 3.5389374E+01-8.0075256E+01 3.5394932E+01
+-8.0084129E+01 3.5394951E+01-8.0093933E+01 3.5401890E+01
+-8.0090347E+01 3.5415413E+01-8.0100723E+01 3.5429764E+01
+-8.0097694E+01 3.5437958E+01-8.0108879E+01 3.5444950E+01
+-8.0110146E+01 3.5460842E+01-8.0118477E+01 3.5465122E+01
+-8.0129570E+01 3.5467007E+01-8.0140144E+01 3.5474915E+01
+-8.0149345E+01 3.5472473E+01-8.0161957E+01 3.5475067E+01
+-8.0166084E+01 3.5480083E+01-8.0176476E+01 3.5485287E+01
+-8.0182907E+01 3.5504196E+01
+ 262 30315 190 172 91 76 32
+-8.0075607E+01 3.5142933E+01-8.0089386E+01 3.5160099E+01
+-8.0107765E+01 3.5173172E+01-8.0108475E+01 3.5188862E+01
+-8.0113495E+01 3.5194172E+01-8.0122757E+01 3.5192196E+01
+-8.0128891E+01 3.5187481E+01-8.0124626E+01 3.5174583E+01
+-8.0131798E+01 3.5173420E+01-8.0135429E+01 3.5167900E+01
+-8.0142601E+01 3.5168293E+01-8.0153137E+01 3.5174595E+01
+-8.0157654E+01 3.5173038E+01-8.0159470E+01 3.5167107E+01
+-8.0168007E+01 3.5161385E+01-8.0160034E+01 3.5151142E+01
+-8.0161430E+01 3.5148441E+01-8.0165977E+01 3.5147434E+01
+-8.0175568E+01 3.5148006E+01-8.0191635E+01 3.5156006E+01
+-8.0197815E+01 3.5166607E+01-8.0204987E+01 3.5165459E+01
+-8.0208420E+01 3.5155773E+01-8.0225647E+01 3.5156342E+01
+-8.0241226E+01 3.5178139E+01-8.0240334E+01 3.5187874E+01
+-8.0251389E+01 3.5203094E+01-8.0251167E+01 3.5208775E+01
+-8.0253532E+01 3.5210838E+01-8.0264030E+01 3.5208397E+01
+-8.0265099E+01 3.5204113E+01-8.0277428E+01 3.5195992E+01
+ 263 46013 190 185 74 95 24
+-8.0075607E+01 3.5142933E+01-8.0033928E+01 3.5140182E+01
+-8.0022270E+01 3.5137196E+01-7.9982590E+01 3.5158928E+01
+-7.9976349E+01 3.5156769E+01-7.9954758E+01 3.5156162E+01
+-7.9949715E+01 3.5157539E+01-7.9944611E+01 3.5164143E+01
+-7.9898849E+01 3.5161564E+01-7.9851250E+01 3.5183640E+01
+-7.9835983E+01 3.5177048E+01-7.9810127E+01 3.5179707E+01
+-7.9792839E+01 3.5175835E+01-7.9767426E+01 3.5177353E+01
+-7.9757973E+01 3.5173416E+01-7.9750000E+01 3.5172810E+01
+-7.9735123E+01 3.5178177E+01-7.9712654E+01 3.5172947E+01
+-7.9694313E+01 3.5179455E+01-7.9673889E+01 3.5175198E+01
+-7.9663353E+01 3.5170475E+01-7.9657913E+01 3.5164474E+01
+-7.9642418E+01 3.5157516E+01-7.9614532E+01 3.5163551E+01
+ 264 43484 192 189 80 1 38
+-8.2764610E+01 3.5068062E+01-8.2756790E+01 3.5067173E+01
+-8.2751556E+01 3.5074429E+01-8.2751213E+01 3.5081364E+01
+-8.2738907E+01 3.5078083E+01-8.2734482E+01 3.5086933E+01
+-8.2729729E+01 3.5087509E+01-8.2726570E+01 3.5094261E+01
+-8.2715446E+01 3.5092827E+01-8.2700424E+01 3.5100735E+01
+-8.2698097E+01 3.5095245E+01-8.2686630E+01 3.5108047E+01
+-8.2694717E+01 3.5115208E+01-8.2692589E+01 3.5118553E+01
+-8.2686890E+01 3.5119675E+01-8.2687233E+01 3.5125000E+01
+-8.2681595E+01 3.5127804E+01-8.2674767E+01 3.5126320E+01
+-8.2673424E+01 3.5117363E+01-8.2669586E+01 3.5120487E+01
+-8.2666779E+01 3.5118061E+01-8.2656815E+01 3.5118683E+01
+-8.2652115E+01 3.5122856E+01-8.2652344E+01 3.5125931E+01
+-8.2645447E+01 3.5126694E+01-8.2641663E+01 3.5132229E+01
+-8.2639870E+01 3.5129684E+01-8.2636627E+01 3.5130249E+01
+-8.2636383E+01 3.5125381E+01-8.2628990E+01 3.5125668E+01
+-8.2624306E+01 3.5133270E+01-8.2615059E+01 3.5136276E+01
+-8.2613235E+01 3.5139610E+01-8.2598297E+01 3.5137611E+01
+-8.2592880E+01 3.5138733E+01-8.2588310E+01 3.5142811E+01
+-8.2579056E+01 3.5141056E+01-8.2575066E+01 3.5145370E+01
+ 265 161 171 178 93 1 18
+-7.5753769E+01 3.5196533E+01-7.5781548E+01 3.5191902E+01
+-7.5868225E+01 3.5154980E+01-7.5938866E+01 3.5127693E+01
+-7.5958122E+01 3.5115650E+01-7.5966949E+01 3.5115650E+01
+-7.5974983E+01 3.5121273E+01-7.5986214E+01 3.5119663E+01
+-7.5991035E+01 3.5108429E+01-7.5991035E+01 3.5094784E+01
+-7.5999016E+01 3.5081207E+01-7.6014427E+01 3.5065742E+01
+-7.6008820E+01 3.5064907E+01-7.5999863E+01 3.5066692E+01
+-7.5965355E+01 3.5097992E+01-7.5934052E+01 3.5118061E+01
+-7.5780739E+01 3.5180668E+01-7.5750946E+01 3.5187092E+01
+ 266 49353 193 192 80 1 6
+-8.2897636E+01 3.5055920E+01-8.2784981E+01 3.5085587E+01
+-8.2776413E+01 3.5080719E+01-8.2782181E+01 3.5064903E+01
+-8.2775215E+01 3.5064548E+01-8.2764610E+01 3.5068062E+01
+ 267 40933 188 191 72 1 13
+-8.1033401E+01 3.5148544E+01-8.1044594E+01 3.5147778E+01
+-8.1051407E+01 3.5133095E+01-8.1050621E+01 3.5130909E+01
+-8.1039169E+01 3.5126156E+01-8.1033005E+01 3.5107906E+01
+-8.1037567E+01 3.5102402E+01-8.1050278E+01 3.5098675E+01
+-8.1057442E+01 3.5085987E+01-8.1057846E+01 3.5062290E+01
+-8.1041687E+01 3.5044559E+01-8.0935150E+01 3.5107265E+01
+-8.0906761E+01 3.5076618E+01
+ 268 36605 194 183 73 90 60
+-7.9459206E+01 3.5042873E+01-7.9335526E+01 3.5161572E+01
+-7.9328728E+01 3.5161388E+01-7.9329536E+01 3.5164368E+01
+-7.9323654E+01 3.5167274E+01-7.9313004E+01 3.5168098E+01
+-7.9310883E+01 3.5172951E+01-7.9304970E+01 3.5175037E+01
+-7.9293060E+01 3.5188202E+01-7.9284889E+01 3.5190514E+01
+-7.9285507E+01 3.5192871E+01-7.9272194E+01 3.5199188E+01
+-7.9264549E+01 3.5199413E+01-7.9260307E+01 3.5204472E+01
+-7.9256317E+01 3.5202869E+01-7.9249557E+01 3.5207996E+01
+-7.9247177E+01 3.5213333E+01-7.9243431E+01 3.5213722E+01
+-7.9241234E+01 3.5208549E+01-7.9236900E+01 3.5210796E+01
+-7.9229980E+01 3.5210499E+01-7.9224266E+01 3.5202759E+01
+-7.9219910E+01 3.5202190E+01-7.9218544E+01 3.5198387E+01
+-7.9212158E+01 3.5194176E+01-7.9206551E+01 3.5193653E+01
+-7.9204765E+01 3.5195690E+01-7.9204514E+01 3.5192669E+01
+-7.9195427E+01 3.5191547E+01-7.9194359E+01 3.5194550E+01
+-7.9189651E+01 3.5192230E+01-7.9188896E+01 3.5193905E+01
+-7.9185074E+01 3.5193466E+01-7.9181641E+01 3.5189602E+01
+-7.9175613E+01 3.5193035E+01-7.9172775E+01 3.5191452E+01
+-7.9173111E+01 3.5186165E+01-7.9168175E+01 3.5184879E+01
+-7.9168762E+01 3.5181194E+01-7.9162514E+01 3.5180416E+01
+-7.9161987E+01 3.5178699E+01-7.9159676E+01 3.5179222E+01
+-7.9160538E+01 3.5182384E+01-7.9154625E+01 3.5180687E+01
+-7.9155243E+01 3.5176773E+01-7.9151894E+01 3.5174091E+01
+-7.9148209E+01 3.5176060E+01-7.9149048E+01 3.5173065E+01
+-7.9143028E+01 3.5168961E+01-7.9137146E+01 3.5171799E+01
+-7.9136696E+01 3.5176971E+01-7.9134430E+01 3.5177452E+01
+-7.9129974E+01 3.5175663E+01-7.9131737E+01 3.5173855E+01
+-7.9125519E+01 3.5166389E+01-7.9119743E+01 3.5171490E+01
+-7.9109756E+01 3.5170593E+01-7.9107986E+01 3.5175392E+01
+-7.9101807E+01 3.5171871E+01-7.9097984E+01 3.5173855E+01
+ 269 46019 185 194 73 95 23
+-7.9614532E+01 3.5163551E+01-7.9608727E+01 3.5150093E+01
+-7.9599442E+01 3.5142559E+01-7.9597374E+01 3.5143612E+01
+-7.9591125E+01 3.5140728E+01-7.9584969E+01 3.5128937E+01
+-7.9575005E+01 3.5121117E+01-7.9576073E+01 3.5098171E+01
+-7.9581718E+01 3.5091370E+01-7.9583221E+01 3.5084293E+01
+-7.9571587E+01 3.5065769E+01-7.9538666E+01 3.5064552E+01
+-7.9529106E+01 3.5066086E+01-7.9525352E+01 3.5063194E+01
+-7.9516541E+01 3.5064728E+01-7.9515320E+01 3.5062874E+01
+-7.9500000E+01 3.5063404E+01-7.9492302E+01 3.5059418E+01
+-7.9488655E+01 3.5060879E+01-7.9486458E+01 3.5058407E+01
+-7.9477882E+01 3.5056950E+01-7.9471169E+01 3.5048134E+01
+-7.9459206E+01 3.5042873E+01
+ 270 49353 195 193 80 1 2
+-8.3008842E+01 3.5027431E+01-8.2897636E+01 3.5055920E+01
+ 271 43121 195 162 71 80 41
+-8.3008842E+01 3.5027431E+01-8.3018463E+01 3.5036892E+01
+-8.3028847E+01 3.5039799E+01-8.3032768E+01 3.5037628E+01
+-8.3043869E+01 3.5051044E+01-8.3056908E+01 3.5053703E+01
+-8.3048561E+01 3.5061077E+01-8.3048134E+01 3.5065880E+01
+-8.3043495E+01 3.5071373E+01-8.3044899E+01 3.5077305E+01
+-8.3037582E+01 3.5079475E+01-8.2983467E+01 3.5131809E+01
+-8.2979149E+01 3.5130131E+01-8.2976738E+01 3.5132881E+01
+-8.2981674E+01 3.5143398E+01-8.2980927E+01 3.5148170E+01
+-8.2984894E+01 3.5150253E+01-8.2989037E+01 3.5148117E+01
+-8.2994995E+01 3.5153530E+01-8.2997879E+01 3.5158314E+01
+-8.2996750E+01 3.5163570E+01-8.2981239E+01 3.5167568E+01
+-8.2988647E+01 3.5174324E+01-8.2985336E+01 3.5180115E+01
+-8.2988747E+01 3.5184952E+01-8.2983276E+01 3.5190018E+01
+-8.2969246E+01 3.5193939E+01-8.2967499E+01 3.5199612E+01
+-8.2962959E+01 3.5201134E+01-8.2960327E+01 3.5205093E+01
+-8.2959496E+01 3.5215790E+01-8.2945702E+01 3.5222919E+01
+-8.2935684E+01 3.5224937E+01-8.2931969E+01 3.5228779E+01
+-8.2927269E+01 3.5238403E+01-8.2928543E+01 3.5241688E+01
+-8.2924744E+01 3.5245834E+01-8.2925285E+01 3.5254475E+01
+-8.2919968E+01 3.5266788E+01-8.2922394E+01 3.5282799E+01
+-8.2920967E+01 3.5291763E+01
+ 272 160 196 157 84 1 14
+-7.6649696E+01 3.5016823E+01-7.6657562E+01 3.5041809E+01
+-7.6629494E+01 3.5060051E+01-7.6605637E+01 3.5064259E+01
+-7.6570557E+01 3.5096535E+01-7.6538284E+01 3.5154068E+01
+-7.6520042E+01 3.5203182E+01-7.6489166E+01 3.5218620E+01
+-7.6466721E+01 3.5264927E+01-7.6466721E+01 3.5278961E+01
+-7.6484962E+01 3.5314041E+01-7.6574768E+01 3.5329475E+01
+-7.6605637E+01 3.5329475E+01-7.6611359E+01 3.5334160E+01
+ 273 36276 168 197 89 79 7
+-7.7474113E+01 3.5228455E+01-7.7526024E+01 3.5242477E+01
+-7.7510689E+01 3.5170044E+01-7.7512337E+01 3.5163620E+01
+-7.7527046E+01 3.5154385E+01-7.7601967E+01 3.5071007E+01
+-7.7730774E+01 3.5007549E+01
+ 274 38097 197 182 94 79 6
+-7.7730774E+01 3.5007549E+01-7.7746277E+01 3.5022324E+01
+-7.7749580E+01 3.5058300E+01-7.7749474E+01 3.5107769E+01
+-7.7769608E+01 3.5145512E+01-7.7834549E+01 3.5177650E+01
+ 275 33255 198 169 72 92 8
+-8.0840485E+01 3.5001560E+01-8.0838531E+01 3.5004883E+01
+-8.0824387E+01 3.5012447E+01-8.0822441E+01 3.5016296E+01
+-8.0809349E+01 3.5022800E+01-8.0805206E+01 3.5027794E+01
+-8.0769447E+01 3.5034863E+01-8.0550491E+01 3.5208263E+01
+ 276 40933 191 198 72 1 2
+-8.0906761E+01 3.5076618E+01-8.0840485E+01 3.5001560E+01
+ 277 43997 199 195 71 1 2
+-8.3108665E+01 3.5000683E+01-8.3008842E+01 3.5027431E+01
+ 278 44099 199 158 85 71 61
+-8.3108665E+01 3.5000683E+01-8.3108551E+01 3.5009048E+01
+-8.3112503E+01 3.5013008E+01-8.3117317E+01 3.5011562E+01
+-8.3126503E+01 3.5015682E+01-8.3126747E+01 3.5023445E+01
+-8.3130501E+01 3.5026493E+01-8.3132881E+01 3.5033871E+01
+-8.3131165E+01 3.5039089E+01-8.3135429E+01 3.5038059E+01
+-8.3148132E+01 3.5053795E+01-8.3163780E+01 3.5056732E+01
+-8.3171486E+01 3.5060619E+01-8.3169403E+01 3.5061775E+01
+-8.3172272E+01 3.5068867E+01-8.3164734E+01 3.5071259E+01
+-8.3158981E+01 3.5078220E+01-8.3143578E+01 3.5078690E+01
+-8.3147614E+01 3.5091541E+01-8.3153015E+01 3.5098171E+01
+-8.3161087E+01 3.5098324E+01-8.3167107E+01 3.5104954E+01
+-8.3171165E+01 3.5105053E+01-8.3178047E+01 3.5109715E+01
+-8.3186913E+01 3.5133354E+01-8.3209610E+01 3.5150284E+01
+-8.3212601E+01 3.5157478E+01-8.3220535E+01 3.5158783E+01
+-8.3223831E+01 3.5157345E+01-8.3224571E+01 3.5187946E+01
+-8.3222717E+01 3.5192764E+01-8.3218719E+01 3.5193218E+01
+-8.3219475E+01 3.5206215E+01-8.3216286E+01 3.5209457E+01
+-8.3218590E+01 3.5221024E+01-8.3216644E+01 3.5222897E+01
+-8.3221878E+01 3.5229130E+01-8.3223824E+01 3.5237915E+01
+-8.3232857E+01 3.5240177E+01-8.3243065E+01 3.5239040E+01
+-8.3245399E+01 3.5231342E+01-8.3260277E+01 3.5231194E+01
+-8.3276192E+01 3.5227966E+01-8.3292923E+01 3.5234833E+01
+-8.3294395E+01 3.5241508E+01-8.3296936E+01 3.5242558E+01
+-8.3295532E+01 3.5247944E+01-8.3298553E+01 3.5255554E+01
+-8.3308388E+01 3.5256992E+01-8.3310959E+01 3.5259014E+01
+-8.3310165E+01 3.5263779E+01-8.3316063E+01 3.5264679E+01
+-8.3314095E+01 3.5268963E+01-8.3315727E+01 3.5273964E+01
+-8.3312073E+01 3.5281673E+01-8.3318405E+01 3.5289001E+01
+-8.3317352E+01 3.5298374E+01-8.3322670E+01 3.5301285E+01
+-8.3321159E+01 3.5311813E+01-8.3330513E+01 3.5314747E+01
+-8.3339828E+01 3.5330910E+01
+ 279 35497 199 200 1 85 2
+-8.3108665E+01 3.5000683E+01-8.3483398E+01 3.4993198E+01
+ 280 35448 187 200 85 96 59
+-8.3738213E+01 3.5155819E+01-8.3726898E+01 3.5145065E+01
+-8.3714691E+01 3.5155205E+01-8.3699745E+01 3.5152420E+01
+-8.3694595E+01 3.5155842E+01-8.3687088E+01 3.5154057E+01
+-8.3684410E+01 3.5157688E+01-8.3678284E+01 3.5155445E+01
+-8.3673676E+01 3.5156986E+01-8.3665970E+01 3.5149994E+01
+-8.3659531E+01 3.5154297E+01-8.3659882E+01 3.5160152E+01
+-8.3653534E+01 3.5156860E+01-8.3652321E+01 3.5153824E+01
+-8.3647598E+01 3.5152924E+01-8.3649536E+01 3.5148060E+01
+-8.3645027E+01 3.5144764E+01-8.3649658E+01 3.5140293E+01
+-8.3657867E+01 3.5139961E+01-8.3654655E+01 3.5135525E+01
+-8.3649208E+01 3.5134850E+01-8.3640289E+01 3.5138271E+01
+-8.3637390E+01 3.5133560E+01-8.3644043E+01 3.5132145E+01
+-8.3640388E+01 3.5130356E+01-8.3635139E+01 3.5121101E+01
+-8.3632416E+01 3.5125000E+01-8.3624847E+01 3.5124783E+01
+-8.3626877E+01 3.5131130E+01-8.3619102E+01 3.5128201E+01
+-8.3619003E+01 3.5119370E+01-8.3614738E+01 3.5113087E+01
+-8.3618813E+01 3.5108501E+01-8.3617905E+01 3.5105556E+01
+-8.3604553E+01 3.5101269E+01-8.3596535E+01 3.5094204E+01
+-8.3587074E+01 3.5091568E+01-8.3584000E+01 3.5087017E+01
+-8.3585114E+01 3.5081470E+01-8.3581795E+01 3.5078285E+01
+-8.3575623E+01 3.5071716E+01-8.3567131E+01 3.5070938E+01
+-8.3568123E+01 3.5066734E+01-8.3562340E+01 3.5059395E+01
+-8.3566772E+01 3.5050777E+01-8.3558243E+01 3.5038857E+01
+-8.3547821E+01 3.5039455E+01-8.3538712E+01 3.5036121E+01
+-8.3521439E+01 3.5018124E+01-8.3521912E+01 3.5013332E+01
+-8.3527115E+01 3.5009064E+01-8.3522102E+01 3.5003551E+01
+-8.3520798E+01 3.4996300E+01-8.3517502E+01 3.4997700E+01
+-8.3516891E+01 3.5001717E+01-8.3510551E+01 3.5005123E+01
+-8.3504631E+01 3.5000603E+01-8.3487907E+01 3.4998699E+01
+-8.3483398E+01 3.4993198E+01
+ 281 35491 201 200 96 1 2
+-8.3549507E+01 3.4992401E+01-8.3483398E+01 3.4993198E+01
+ 282 35020 170 202 87 1 2
+-8.4292397E+01 3.5206600E+01-8.4321953E+01 3.4988327E+01
+ 283 35452 202 203 87 1 2
+-8.4321953E+01 3.4988327E+01-8.4129639E+01 3.4987423E+01
+ 284 35491 205 204 96 1 2
+-8.4005501E+01 3.4987251E+01-8.3936745E+01 3.4987400E+01
+ 285 35394 187 205 96 87 39
+-8.3738213E+01 3.5155819E+01-8.3745941E+01 3.5160542E+01
+-8.3752647E+01 3.5160774E+01-8.3755867E+01 3.5157135E+01
+-8.3770660E+01 3.5156456E+01-8.3778343E+01 3.5149864E+01
+-8.3794884E+01 3.5147953E+01-8.3797287E+01 3.5144882E+01
+-8.3806763E+01 3.5143944E+01-8.3808235E+01 3.5141411E+01
+-8.3816940E+01 3.5139229E+01-8.3833099E+01 3.5140511E+01
+-8.3834694E+01 3.5142876E+01-8.3841209E+01 3.5143768E+01
+-8.3852615E+01 3.5139481E+01-8.3862854E+01 3.5132515E+01
+-8.3865547E+01 3.5127277E+01-8.3863686E+01 3.5120235E+01
+-8.3874794E+01 3.5113728E+01-8.3895988E+01 3.5091587E+01
+-8.3905441E+01 3.5086765E+01-8.3908203E+01 3.5077850E+01
+-8.3922623E+01 3.5074024E+01-8.3926941E+01 3.5066914E+01
+-8.3933937E+01 3.5068562E+01-8.3942345E+01 3.5056770E+01
+-8.3948074E+01 3.5053913E+01-8.3956367E+01 3.5054184E+01
+-8.3964073E+01 3.5048004E+01-8.3962738E+01 3.5045898E+01
+-8.3966049E+01 3.5043976E+01-8.3958450E+01 3.5038734E+01
+-8.3960594E+01 3.5030762E+01-8.3956886E+01 3.5025856E+01
+-8.3971321E+01 3.5015270E+01-8.3971359E+01 3.5012085E+01
+-8.3979866E+01 3.5005627E+01-8.4004082E+01 3.4995007E+01
+-8.4005501E+01 3.4987251E+01
+ 286 35452 203 205 87 1 2
+-8.4129639E+01 3.4987423E+01-8.4005501E+01 3.4987251E+01
+ 287 35491 204 201 96 1 4
+-8.3936745E+01 3.4987400E+01-8.3620102E+01 3.4986500E+01
+-8.3620300E+01 3.4992001E+01-8.3549507E+01 3.4992401E+01
+ 288 30872 206 196 84 97 2
+-7.6711624E+01 3.4981812E+01-7.6649696E+01 3.5016823E+01
+ 289 38066 207 197 94 89 3
+-7.7679001E+01 3.4972218E+01-7.7691704E+01 3.4983448E+01
+-7.7730774E+01 3.5007549E+01
+ 290 36522 183 208 88 90 26
+-7.9097984E+01 3.5173855E+01-7.9113251E+01 3.5125473E+01
+-7.9105537E+01 3.5121376E+01-7.9101357E+01 3.5114544E+01
+-7.9098541E+01 3.5093922E+01-7.9093452E+01 3.5090065E+01
+-7.9093636E+01 3.5079552E+01-7.9090736E+01 3.5077919E+01
+-7.9089569E+01 3.5071136E+01-7.9092270E+01 3.5063969E+01
+-7.9090538E+01 3.5059174E+01-7.9093353E+01 3.5055828E+01
+-7.9088425E+01 3.5051498E+01-7.9088226E+01 3.5049347E+01
+-7.9091988E+01 3.5047497E+01-7.9090340E+01 3.5041885E+01
+-7.9072296E+01 3.5016682E+01-7.9061134E+01 3.5007244E+01
+-7.9057014E+01 3.4998215E+01-7.9049843E+01 3.4991596E+01
+-7.9047295E+01 3.4978283E+01-7.9041245E+01 3.4967575E+01
+-7.9037773E+01 3.4967049E+01-7.9035103E+01 3.4963020E+01
+-7.9037277E+01 3.4957592E+01-7.9034958E+01 3.4953419E+01
+ 291 30775 206 165 82 84 36
+-7.6711624E+01 3.4981812E+01-7.6762337E+01 3.4953671E+01
+-7.6780930E+01 3.4950275E+01-7.6819458E+01 3.4952312E+01
+-7.6901649E+01 3.4983940E+01-7.6949554E+01 3.5017300E+01
+-7.6967628E+01 3.5040497E+01-7.6950478E+01 3.5054127E+01
+-7.6941109E+01 3.5064781E+01-7.6939758E+01 3.5075893E+01
+-7.6935509E+01 3.5079708E+01-7.6939507E+01 3.5088940E+01
+-7.6937584E+01 3.5101097E+01-7.6940651E+01 3.5102913E+01
+-7.6935043E+01 3.5106216E+01-7.6944275E+01 3.5120579E+01
+-7.6976318E+01 3.5133617E+01-7.6984467E+01 3.5143707E+01
+-7.6987762E+01 3.5154629E+01-7.6977531E+01 3.5155273E+01
+-7.6970703E+01 3.5161503E+01-7.6969231E+01 3.5171005E+01
+-7.6971489E+01 3.5178261E+01-7.6966362E+01 3.5181763E+01
+-7.6962326E+01 3.5200218E+01-7.6952087E+01 3.5207687E+01
+-7.6945534E+01 3.5209129E+01-7.6942551E+01 3.5214783E+01
+-7.6943695E+01 3.5222298E+01-7.6932983E+01 3.5229942E+01
+-7.6920006E+01 3.5234657E+01-7.6911385E+01 3.5234200E+01
+-7.6905418E+01 3.5236530E+01-7.6902008E+01 3.5241318E+01
+-7.6902786E+01 3.5246147E+01-7.6896019E+01 3.5253464E+01
+ 292 36476 209 167 88 86 74
+-7.8495041E+01 3.4856094E+01-7.8495064E+01 3.4858952E+01
+-7.8499199E+01 3.4859360E+01-7.8502724E+01 3.4864227E+01
+-7.8513100E+01 3.4868889E+01-7.8513863E+01 3.4881744E+01
+-7.8522942E+01 3.4883450E+01-7.8525696E+01 3.4884861E+01
+-7.8526779E+01 3.4890835E+01-7.8535965E+01 3.4893768E+01
+-7.8537056E+01 3.4892303E+01-7.8538002E+01 3.4895439E+01
+-7.8545494E+01 3.4900726E+01-7.8542046E+01 3.4910686E+01
+-7.8546410E+01 3.4916111E+01-7.8553139E+01 3.4914967E+01
+-7.8560997E+01 3.4917255E+01-7.8562416E+01 3.4921127E+01
+-7.8572762E+01 3.4930008E+01-7.8571533E+01 3.4936237E+01
+-7.8582626E+01 3.4938248E+01-7.8597504E+01 3.4951752E+01
+-7.8607094E+01 3.4953465E+01-7.8611069E+01 3.4960720E+01
+-7.8632683E+01 3.4978092E+01-7.8637924E+01 3.4987911E+01
+-7.8643967E+01 3.4989178E+01-7.8647888E+01 3.5005257E+01
+-7.8645523E+01 3.5009926E+01-7.8653221E+01 3.5020802E+01
+-7.8650322E+01 3.5026321E+01-7.8658363E+01 3.5039669E+01
+-7.8654770E+01 3.5049988E+01-7.8664337E+01 3.5067093E+01
+-7.8663414E+01 3.5078331E+01-7.8669403E+01 3.5080482E+01
+-7.8672653E+01 3.5085453E+01-7.8669533E+01 3.5093166E+01
+-7.8663971E+01 3.5092178E+01-7.8658897E+01 3.5093964E+01
+-7.8659225E+01 3.5100033E+01-7.8654823E+01 3.5100536E+01
+-7.8652344E+01 3.5103439E+01-7.8653931E+01 3.5111225E+01
+-7.8643372E+01 3.5113052E+01-7.8639549E+01 3.5116005E+01
+-7.8641563E+01 3.5120720E+01-7.8649971E+01 3.5117447E+01
+-7.8652672E+01 3.5120609E+01-7.8636124E+01 3.5136757E+01
+-7.8638367E+01 3.5147171E+01-7.8636414E+01 3.5150604E+01
+-7.8639984E+01 3.5155117E+01-7.8637810E+01 3.5157337E+01
+-7.8634125E+01 3.5157059E+01-7.8633087E+01 3.5163719E+01
+-7.8637497E+01 3.5164703E+01-7.8638908E+01 3.5167316E+01
+-7.8636208E+01 3.5170471E+01-7.8632225E+01 3.5169601E+01
+-7.8629936E+01 3.5171867E+01-7.8639297E+01 3.5182037E+01
+-7.8640076E+01 3.5185837E+01-7.8636108E+01 3.5191833E+01
+-7.8640266E+01 3.5192200E+01-7.8646950E+01 3.5197514E+01
+-7.8642914E+01 3.5200741E+01-7.8635635E+01 3.5198078E+01
+-7.8624680E+01 3.5203411E+01-7.8632133E+01 3.5211079E+01
+-7.8617538E+01 3.5227818E+01-7.8619164E+01 3.5233379E+01
+-7.8615669E+01 3.5238300E+01-7.8617462E+01 3.5245556E+01
+ 293 43595 194 210 90 98 36
+-7.9459206E+01 3.5042873E+01-7.9449303E+01 3.5026451E+01
+-7.9442291E+01 3.5021873E+01-7.9431633E+01 3.5019833E+01
+-7.9424973E+01 3.5010056E+01-7.9416069E+01 3.5002655E+01
+-7.9410065E+01 3.5001534E+01-7.9396851E+01 3.4993706E+01
+-7.9388817E+01 3.4981335E+01-7.9378944E+01 3.4975491E+01
+-7.9370773E+01 3.4966702E+01-7.9370354E+01 3.4963356E+01
+-7.9367317E+01 3.4962261E+01-7.9361008E+01 3.4957863E+01
+-7.9363762E+01 3.4954109E+01-7.9362358E+01 3.4950214E+01
+-7.9358383E+01 3.4949303E+01-7.9353355E+01 3.4943874E+01
+-7.9353516E+01 3.4936596E+01-7.9356430E+01 3.4932632E+01
+-7.9350143E+01 3.4921207E+01-7.9352470E+01 3.4911175E+01
+-7.9348770E+01 3.4901333E+01-7.9350517E+01 3.4894207E+01
+-7.9348572E+01 3.4886272E+01-7.9344398E+01 3.4877655E+01
+-7.9346062E+01 3.4875961E+01-7.9342278E+01 3.4871616E+01
+-7.9343887E+01 3.4868019E+01-7.9341835E+01 3.4861885E+01
+-7.9338135E+01 3.4858883E+01-7.9337189E+01 3.4853596E+01
+-7.9345573E+01 3.4845764E+01-7.9345520E+01 3.4843178E+01
+-7.9348274E+01 3.4842785E+01-7.9348297E+01 3.4838295E+01
+ 294 34163 211 206 82 97 10
+-7.7049896E+01 3.4834869E+01-7.6883568E+01 3.4844650E+01
+-7.6756432E+01 3.4846989E+01-7.6625000E+01 3.4892811E+01
+-7.6626984E+01 3.4896580E+01-7.6634575E+01 3.4897587E+01
+-7.6663193E+01 3.4912491E+01-7.6653397E+01 3.4932652E+01
+-7.6654556E+01 3.4936928E+01-7.6711624E+01 3.4981812E+01
+ 295 31381 212 209 88 101 7
+-7.8901352E+01 3.4834625E+01-7.8843307E+01 3.4847198E+01
+-7.8800583E+01 3.4849869E+01-7.8533707E+01 3.4851101E+01
+-7.8515503E+01 3.4845699E+01-7.8505798E+01 3.4852402E+01
+-7.8495041E+01 3.4856094E+01
+ 296 36653 208 212 88 100 11
+-7.9034958E+01 3.4953419E+01-7.8956398E+01 3.4913681E+01
+-7.8947762E+01 3.4905415E+01-7.8942223E+01 3.4903954E+01
+-7.8939674E+01 3.4897953E+01-7.8927551E+01 3.4886963E+01
+-7.8923470E+01 3.4877254E+01-7.8922058E+01 3.4869019E+01
+-7.8927246E+01 3.4864166E+01-7.8903931E+01 3.4834126E+01
+-7.8901352E+01 3.4834625E+01
+ 297 36740 210 208 90 100 3
+-7.9348297E+01 3.4838295E+01-7.9191666E+01 3.4833218E+01
+-7.9034958E+01 3.4953419E+01
+ 298 36138 168 211 82 89 26
+-7.7474113E+01 3.5228455E+01-7.7464317E+01 3.5225746E+01
+-7.7329506E+01 3.5149353E+01-7.7200539E+01 3.5091595E+01
+-7.7197784E+01 3.5087891E+01-7.7188774E+01 3.5084053E+01
+-7.7191116E+01 3.5076366E+01-7.7189651E+01 3.5066090E+01
+-7.7180038E+01 3.5059975E+01-7.7177856E+01 3.5056076E+01
+-7.7164955E+01 3.5065556E+01-7.7159981E+01 3.5062477E+01
+-7.7154861E+01 3.5062626E+01-7.7147690E+01 3.5056789E+01
+-7.7145180E+01 3.5060528E+01-7.7137192E+01 3.5063358E+01
+-7.7130554E+01 3.5073849E+01-7.7125351E+01 3.5077404E+01
+-7.7114113E+01 3.5074013E+01-7.7109619E+01 3.5067245E+01
+-7.7110046E+01 3.5045952E+01-7.7107368E+01 3.5035858E+01
+-7.7099396E+01 3.5026581E+01-7.7103287E+01 3.5019730E+01
+-7.7111855E+01 3.4831097E+01-7.7049896E+01 3.4834869E+01
+ 299 45421 198 213 92 1 4
+-8.0840485E+01 3.5001560E+01-8.0782249E+01 3.4935635E+01
+-8.0797752E+01 3.4819641E+01-8.0561874E+01 3.4817329E+01
+ 300 30317 172 214 91 92 2
+-8.0277428E+01 3.5195992E+01-8.0320625E+01 3.4813854E+01
+ 301 45421 213 214 92 1 2
+-8.0561874E+01 3.4817329E+01-8.0320625E+01 3.4813854E+01
+ 302 30206 190 215 95 91 35
+-8.0075607E+01 3.5142933E+01-8.0068001E+01 3.5111748E+01
+-8.0042053E+01 3.5102875E+01-8.0024796E+01 3.5090675E+01
+-7.9999489E+01 3.5085243E+01-7.9987251E+01 3.5088276E+01
+-7.9979240E+01 3.5100319E+01-7.9956306E+01 3.5114342E+01
+-7.9942345E+01 3.5118774E+01-7.9926445E+01 3.5116798E+01
+-7.9923065E+01 3.5113216E+01-7.9921883E+01 3.5106380E+01
+-7.9912621E+01 3.5096344E+01-7.9912819E+01 3.5079018E+01
+-7.9909706E+01 3.5067284E+01-7.9899704E+01 3.5059372E+01
+-7.9882957E+01 3.5050735E+01-7.9875679E+01 3.5042130E+01
+-7.9877495E+01 3.5035793E+01-7.9892967E+01 3.5022690E+01
+-7.9899918E+01 3.5005493E+01-7.9879768E+01 3.4987926E+01
+-7.9865219E+01 3.4979988E+01-7.9863831E+01 3.4974857E+01
+-7.9872437E+01 3.4949970E+01-7.9866478E+01 3.4938576E+01
+-7.9860077E+01 3.4932697E+01-7.9848770E+01 3.4904404E+01
+-7.9850204E+01 3.4899162E+01-7.9870453E+01 3.4875000E+01
+-7.9885223E+01 3.4862946E+01-7.9900894E+01 3.4857525E+01
+-7.9909149E+01 3.4840874E+01-7.9914368E+01 3.4817863E+01
+-7.9927834E+01 3.4806400E+01
+ 303 30255 214 215 91 1 2
+-8.0320625E+01 3.4813854E+01-7.9927834E+01 3.4806400E+01
+ 304 43659 194 216 98 95 32
+-7.9459206E+01 3.5042873E+01-7.9470268E+01 3.5035767E+01
+-7.9512009E+01 3.5025593E+01-7.9572266E+01 3.4992912E+01
+-7.9577858E+01 3.4978760E+01-7.9575653E+01 3.4973793E+01
+-7.9581718E+01 3.4964054E+01-7.9582138E+01 3.4956913E+01
+-7.9585693E+01 3.4954964E+01-7.9583496E+01 3.4947475E+01
+-7.9585114E+01 3.4943859E+01-7.9579124E+01 3.4931194E+01
+-7.9572624E+01 3.4929203E+01-7.9564674E+01 3.4918968E+01
+-7.9565903E+01 3.4910370E+01-7.9561836E+01 3.4910080E+01
+-7.9616219E+01 3.4865810E+01-7.9626953E+01 3.4851936E+01
+-7.9620300E+01 3.4848846E+01-7.9623970E+01 3.4842663E+01
+-7.9617798E+01 3.4839092E+01-7.9620377E+01 3.4834854E+01
+-7.9619354E+01 3.4830963E+01-7.9622543E+01 3.4828949E+01
+-7.9623032E+01 3.4820038E+01-7.9614288E+01 3.4814957E+01
+-7.9626381E+01 3.4818089E+01-7.9634598E+01 3.4825191E+01
+-7.9654701E+01 3.4814621E+01-7.9678619E+01 3.4813683E+01
+-7.9688416E+01 3.4811050E+01-7.9687721E+01 3.4804733E+01
+ 305 47938 215 216 95 1 2
+-7.9927834E+01 3.4806400E+01-7.9687721E+01 3.4804733E+01
+ 306 34267 211 217 97 89 19
+-7.7049896E+01 3.4834869E+01-7.7055008E+01 3.4823780E+01
+-7.7052704E+01 3.4818813E+01-7.7068115E+01 3.4821148E+01
+-7.7079544E+01 3.4810204E+01-7.7089645E+01 3.4808781E+01
+-7.7091415E+01 3.4798981E+01-7.7107712E+01 3.4802666E+01
+-7.7116310E+01 3.4794189E+01-7.7124054E+01 3.4792377E+01
+-7.7131104E+01 3.4797874E+01-7.7142265E+01 3.4796642E+01
+-7.7144234E+01 3.4793301E+01-7.7150452E+01 3.4792389E+01
+-7.7161797E+01 3.4794933E+01-7.7164024E+01 3.4790813E+01
+-7.7167938E+01 3.4790878E+01-7.7162384E+01 3.4786667E+01
+-7.7166328E+01 3.4784794E+01
+ 307 38149 217 207 99 89 56
+-7.7166328E+01 3.4784794E+01-7.7170013E+01 3.4780212E+01
+-7.7173187E+01 3.4780464E+01-7.7170464E+01 3.4784767E+01
+-7.7175484E+01 3.4787079E+01-7.7171211E+01 3.4789577E+01
+-7.7176208E+01 3.4791821E+01-7.7175758E+01 3.4795757E+01
+-7.7191162E+01 3.4802010E+01-7.7190002E+01 3.4805740E+01
+-7.7196465E+01 3.4809086E+01-7.7193718E+01 3.4813683E+01
+-7.7195877E+01 3.4817230E+01-7.7187469E+01 3.4818607E+01
+-7.7185112E+01 3.4825497E+01-7.7179955E+01 3.4828976E+01
+-7.7181389E+01 3.4835732E+01-7.7184998E+01 3.4836418E+01
+-7.7188637E+01 3.4833351E+01-7.7192284E+01 3.4833672E+01
+-7.7191437E+01 3.4831978E+01-7.7202217E+01 3.4834061E+01
+-7.7203857E+01 3.4836666E+01-7.7201309E+01 3.4841358E+01
+-7.7212219E+01 3.4852371E+01-7.7210335E+01 3.4858509E+01
+-7.7219223E+01 3.4867390E+01-7.7219978E+01 3.4870750E+01
+-7.7215973E+01 3.4873573E+01-7.7222389E+01 3.4882015E+01
+-7.7221748E+01 3.4886608E+01-7.7233810E+01 3.4885880E+01
+-7.7232040E+01 3.4892818E+01-7.7238571E+01 3.4893436E+01
+-7.7237984E+01 3.4899410E+01-7.7250481E+01 3.4901150E+01
+-7.7252449E+01 3.4903027E+01-7.7251694E+01 3.4909756E+01
+-7.7260147E+01 3.4909054E+01-7.7260002E+01 3.4914524E+01
+-7.7268303E+01 3.4925606E+01-7.7282814E+01 3.4927601E+01
+-7.7285683E+01 3.4931171E+01-7.7294434E+01 3.4930210E+01
+-7.7308586E+01 3.4937405E+01-7.7317055E+01 3.4932022E+01
+-7.7318527E+01 3.4934608E+01-7.7329651E+01 3.4938110E+01
+-7.7339104E+01 3.4935570E+01-7.7345856E+01 3.4930325E+01
+-7.7357414E+01 3.4928967E+01-7.7365585E+01 3.4923264E+01
+-7.7366608E+01 3.4911476E+01-7.7503021E+01 3.4969467E+01
+-7.7639175E+01 3.4984245E+01-7.7679001E+01 3.4972218E+01
+ 308 38088 219 207 94 99 5
+-7.7680862E+01 3.4720474E+01-7.7686096E+01 3.4732765E+01
+-7.7685249E+01 3.4739174E+01-7.7651352E+01 3.4923698E+01
+-7.7679001E+01 3.4972218E+01
+ 309 38144 218 219 94 102 38
+-7.8113472E+01 3.4721836E+01-7.8101608E+01 3.4725410E+01
+-7.8095650E+01 3.4723171E+01-7.8087524E+01 3.4725117E+01
+-7.8081375E+01 3.4722416E+01-7.8071236E+01 3.4724617E+01
+-7.8066795E+01 3.4727821E+01-7.8050797E+01 3.4724590E+01
+-7.8041351E+01 3.4727310E+01-7.8039162E+01 3.4725918E+01
+-7.8036911E+01 3.4728134E+01-7.8036392E+01 3.4725433E+01
+-7.8033066E+01 3.4727676E+01-7.8031120E+01 3.4724609E+01
+-7.8026909E+01 3.4726257E+01-7.8024910E+01 3.4730213E+01
+-7.8018028E+01 3.4732109E+01-7.8010216E+01 3.4731304E+01
+-7.8008011E+01 3.4725971E+01-7.8002747E+01 3.4725876E+01
+-7.8002991E+01 3.4723568E+01-7.7992683E+01 3.4715813E+01
+-7.7988251E+01 3.4717190E+01-7.7981819E+01 3.4713757E+01
+-7.7979622E+01 3.4716801E+01-7.7975220E+01 3.4714241E+01
+-7.7974335E+01 3.4718933E+01-7.7962250E+01 3.4719601E+01
+-7.7959175E+01 3.4715454E+01-7.7952744E+01 3.4714291E+01
+-7.7952103E+01 3.4717564E+01-7.7940521E+01 3.4719898E+01
+-7.7939003E+01 3.4723171E+01-7.7937836E+01 3.4720154E+01
+-7.7936142E+01 3.4722557E+01-7.7930794E+01 3.4722668E+01
+-7.7922203E+01 3.4719604E+01-7.7680862E+01 3.4720474E+01
+ 310 38284 176 218 94 86 11
+-7.8163826E+01 3.5189209E+01-7.8163025E+01 3.5137123E+01
+-7.8171402E+01 3.5114845E+01-7.8171913E+01 3.5093414E+01
+-7.8159927E+01 3.5079620E+01-7.8147003E+01 3.4902294E+01
+-7.8200745E+01 3.4737019E+01-7.8149986E+01 3.4721588E+01
+-7.8134842E+01 3.4709194E+01-7.8124512E+01 3.4713295E+01
+-7.8113472E+01 3.4721836E+01
+ 311 34268 217 220 97 99 31
+-7.7166328E+01 3.4784794E+01-7.7165771E+01 3.4778915E+01
+-7.7158806E+01 3.4781387E+01-7.7157646E+01 3.4779240E+01
+-7.7160667E+01 3.4774593E+01-7.7157890E+01 3.4773506E+01
+-7.7154289E+01 3.4776577E+01-7.7151031E+01 3.4771168E+01
+-7.7158470E+01 3.4769295E+01-7.7158478E+01 3.4766041E+01
+-7.7156052E+01 3.4765167E+01-7.7150246E+01 3.4768063E+01
+-7.7143585E+01 3.4765930E+01-7.7141457E+01 3.4759502E+01
+-7.7135704E+01 3.4764084E+01-7.7131149E+01 3.4758320E+01
+-7.7126434E+01 3.4756767E+01-7.7126343E+01 3.4746758E+01
+-7.7121574E+01 3.4731075E+01-7.7112267E+01 3.4722157E+01
+-7.7106628E+01 3.4712540E+01-7.7105629E+01 3.4694527E+01
+-7.7116165E+01 3.4678097E+01-7.7114632E+01 3.4672939E+01
+-7.7099716E+01 3.4669498E+01-7.7096939E+01 3.4665684E+01
+-7.7097359E+01 3.4663105E+01-7.7105057E+01 3.4657722E+01
+-7.7107033E+01 3.4647930E+01-7.7112831E+01 3.4640877E+01
+-7.7112900E+01 3.4640060E+01
+ 312 43675 210 221 100 98 14
+-7.9348297E+01 3.4838295E+01-7.9349274E+01 3.4838322E+01
+-7.9353622E+01 3.4828701E+01-7.9352287E+01 3.4825630E+01
+-7.9357841E+01 3.4820110E+01-7.9350143E+01 3.4810177E+01
+-7.9350426E+01 3.4805023E+01-7.9344116E+01 3.4795979E+01
+-7.9344444E+01 3.4791996E+01-7.9338425E+01 3.4787395E+01
+-7.9339256E+01 3.4785221E+01-7.9337257E+01 3.4785263E+01
+-7.9331009E+01 3.4773724E+01-7.9461983E+01 3.4630272E+01
+ 313 48003 216 221 98 1 3
+-7.9687721E+01 3.4804733E+01-7.9675522E+01 3.4804588E+01
+-7.9461983E+01 3.4630272E+01
+ 314 48173 221 222 100 1 2
+-7.9461983E+01 3.4630272E+01-7.9450264E+01 3.4620876E+01
+ 315 160 220 196 97 1 49
+-7.7112900E+01 3.4640060E+01-7.7111961E+01 3.4640327E+01
+-7.7002953E+01 3.4666065E+01-7.6927246E+01 3.4676662E+01
+-7.6855522E+01 3.4688972E+01-7.6797661E+01 3.4695343E+01
+-7.6722847E+01 3.4696346E+01-7.6674400E+01 3.4690289E+01
+-7.6648666E+01 3.4675148E+01-7.6619896E+01 3.4670609E+01
+-7.6585075E+01 3.4661526E+01-7.6563873E+01 3.4652439E+01
+-7.6554794E+01 3.4628212E+01-7.6554794E+01 3.4613071E+01
+-7.6535110E+01 3.4579765E+01-7.6529053E+01 3.4587337E+01
+-7.6527534E+01 3.4603989E+01-7.6497253E+01 3.4655468E+01
+-7.6477577E+01 3.4681206E+01-7.6391273E+01 3.4778103E+01
+-7.6315567E+01 3.4849262E+01-7.6185364E+01 3.4953735E+01
+-7.6130859E+01 3.4996128E+01-7.6079376E+01 3.5032463E+01
+-7.6035469E+01 3.5059715E+01-7.6040016E+01 3.5065777E+01
+-7.6068787E+01 3.5073345E+01-7.6171738E+01 3.4985527E+01
+-7.6206558E+01 3.4988556E+01-7.6241386E+01 3.4999157E+01
+-7.6286804E+01 3.5008240E+01-7.6364021E+01 3.5037006E+01
+-7.6341309E+01 3.4994614E+01-7.6327682E+01 3.4980988E+01
+-7.6335258E+01 3.4971905E+01-7.6362503E+01 3.4976444E+01
+-7.6424583E+01 3.4997639E+01-7.6438210E+01 3.5008240E+01
+-7.6433662E+01 3.5049122E+01-7.6439720E+01 3.5064259E+01
+-7.6463951E+01 3.5076370E+01-7.6479088E+01 3.5058205E+01
+-7.6491203E+01 3.5026409E+01-7.6506348E+01 3.5008240E+01
+-7.6577507E+01 3.4996128E+01-7.6613838E+01 3.4985527E+01
+-7.6638062E+01 3.4996128E+01-7.6649269E+01 3.5015465E+01
+-7.6649696E+01 3.5016823E+01
+ 316 31494 223 218 86 102 4
+-7.8254906E+01 3.4553711E+01-7.8156456E+01 3.4678425E+01
+-7.8114426E+01 3.4706921E+01-7.8113472E+01 3.4721836E+01
+ 317 31394 223 209 101 86 94
+-7.8254906E+01 3.4553711E+01-7.8260658E+01 3.4556232E+01
+-7.8252350E+01 3.4562431E+01-7.8255142E+01 3.4568542E+01
+-7.8262642E+01 3.4571659E+01-7.8261009E+01 3.4574337E+01
+-7.8264351E+01 3.4576492E+01-7.8266731E+01 3.4583817E+01
+-7.8275505E+01 3.4581509E+01-7.8280449E+01 3.4591030E+01
+-7.8287590E+01 3.4593300E+01-7.8289528E+01 3.4597923E+01
+-7.8292961E+01 3.4597122E+01-7.8291466E+01 3.4600101E+01
+-7.8293900E+01 3.4601471E+01-7.8303200E+01 3.4600468E+01
+-7.8306519E+01 3.4608112E+01-7.8304802E+01 3.4610744E+01
+-7.8306992E+01 3.4613171E+01-7.8312744E+01 3.4613148E+01
+-7.8313583E+01 3.4625626E+01-7.8322800E+01 3.4629627E+01
+-7.8314194E+01 3.4633175E+01-7.8317093E+01 3.4635647E+01
+-7.8311806E+01 3.4639912E+01-7.8314499E+01 3.4644550E+01
+-7.8319153E+01 3.4645767E+01-7.8321281E+01 3.4649567E+01
+-7.8324989E+01 3.4649681E+01-7.8322144E+01 3.4652817E+01
+-7.8326653E+01 3.4655769E+01-7.8327263E+01 3.4664146E+01
+-7.8323914E+01 3.4666664E+01-7.8331177E+01 3.4672478E+01
+-7.8338844E+01 3.4674671E+01-7.8341537E+01 3.4679184E+01
+-7.8347244E+01 3.4680256E+01-7.8344337E+01 3.4683552E+01
+-7.8347168E+01 3.4690353E+01-7.8349297E+01 3.4688202E+01
+-7.8350327E+01 3.4692364E+01-7.8355141E+01 3.4690212E+01
+-7.8357918E+01 3.4692753E+01-7.8361771E+01 3.4691238E+01
+-7.8361778E+01 3.4695293E+01-7.8366623E+01 3.4693043E+01
+-7.8373001E+01 3.4698856E+01-7.8374191E+01 3.4701099E+01
+-7.8369476E+01 3.4700047E+01-7.8371506E+01 3.4702202E+01
+-7.8368736E+01 3.4704006E+01-7.8377045E+01 3.4709496E+01
+-7.8376160E+01 3.4712517E+01-7.8382141E+01 3.4717167E+01
+-7.8379448E+01 3.4723324E+01-7.8383415E+01 3.4723667E+01
+-7.8383385E+01 3.4726120E+01-7.8389107E+01 3.4729122E+01
+-7.8391975E+01 3.4729439E+01-7.8392853E+01 3.4732601E+01
+-7.8387810E+01 3.4737930E+01-7.8392967E+01 3.4741962E+01
+-7.8390106E+01 3.4745693E+01-7.8391464E+01 3.4749645E+01
+-7.8400978E+01 3.4751438E+01-7.8403862E+01 3.4757114E+01
+-7.8408028E+01 3.4757759E+01-7.8406219E+01 3.4759434E+01
+-7.8410316E+01 3.4765293E+01-7.8420967E+01 3.4766209E+01
+-7.8424744E+01 3.4769848E+01-7.8423912E+01 3.4772755E+01
+-7.8430511E+01 3.4776421E+01-7.8429901E+01 3.4781887E+01
+-7.8438942E+01 3.4785553E+01-7.8438004E+01 3.4792374E+01
+-7.8445328E+01 3.4797752E+01-7.8441582E+01 3.4800430E+01
+-7.8449348E+01 3.4807388E+01-7.8449219E+01 3.4812538E+01
+-7.8451820E+01 3.4814072E+01-7.8457062E+01 3.4812321E+01
+-7.8460258E+01 3.4814117E+01-7.8460068E+01 3.4821877E+01
+-7.8465279E+01 3.4820869E+01-7.8467171E+01 3.4822655E+01
+-7.8466064E+01 3.4827690E+01-7.8482582E+01 3.4836544E+01
+-7.8487747E+01 3.4836063E+01-7.8489944E+01 3.4842518E+01
+-7.8493942E+01 3.4843452E+01-7.8492165E+01 3.4848904E+01
+-7.8495583E+01 3.4852268E+01-7.8495041E+01 3.4856094E+01
+ 318 31404 212 224 101 100 68
+-7.8901352E+01 3.4834625E+01-7.8898598E+01 3.4831501E+01
+-7.8900597E+01 3.4827999E+01-7.8892998E+01 3.4813900E+01
+-7.8889107E+01 3.4811298E+01-7.8884003E+01 3.4812199E+01
+-7.8886703E+01 3.4809700E+01-7.8884506E+01 3.4802299E+01
+-7.8875076E+01 3.4785259E+01-7.8865799E+01 3.4774799E+01
+-7.8863701E+01 3.4760300E+01-7.8856796E+01 3.4754398E+01
+-7.8854599E+01 3.4735699E+01-7.8843506E+01 3.4726299E+01
+-7.8845398E+01 3.4723598E+01-7.8839706E+01 3.4721802E+01
+-7.8841400E+01 3.4718700E+01-7.8838402E+01 3.4720600E+01
+-7.8837303E+01 3.4716202E+01-7.8833000E+01 3.4718399E+01
+-7.8831398E+01 3.4714199E+01-7.8821800E+01 3.4708900E+01
+-7.8813400E+01 3.4696201E+01-7.8806503E+01 3.4690399E+01
+-7.8806000E+01 3.4684200E+01-7.8807800E+01 3.4680401E+01
+-7.8805481E+01 3.4674431E+01-7.8809799E+01 3.4670601E+01
+-7.8807999E+01 3.4667301E+01-7.8815308E+01 3.4665199E+01
+-7.8820107E+01 3.4659401E+01-7.8820396E+01 3.4656502E+01
+-7.8815598E+01 3.4656502E+01-7.8812523E+01 3.4651478E+01
+-7.8818649E+01 3.4649780E+01-7.8822067E+01 3.4638443E+01
+-7.8826599E+01 3.4638863E+01-7.8828262E+01 3.4636829E+01
+-7.8829399E+01 3.4624199E+01-7.8833199E+01 3.4623001E+01
+-7.8834999E+01 3.4615002E+01-7.8832245E+01 3.4611588E+01
+-7.8833801E+01 3.4601700E+01-7.8841103E+01 3.4597500E+01
+-7.8839600E+01 3.4595901E+01-7.8835800E+01 3.4597401E+01
+-7.8835197E+01 3.4593300E+01-7.8839706E+01 3.4588799E+01
+-7.8843102E+01 3.4588799E+01-7.8843903E+01 3.4578300E+01
+-7.8847397E+01 3.4574600E+01-7.8857101E+01 3.4572399E+01
+-7.8859001E+01 3.4567699E+01-7.8853706E+01 3.4557201E+01
+-7.8857803E+01 3.4549301E+01-7.8854797E+01 3.4547298E+01
+-7.8859306E+01 3.4537201E+01-7.8854797E+01 3.4534199E+01
+-7.8854706E+01 3.4521500E+01-7.8850700E+01 3.4517601E+01
+-7.8855797E+01 3.4514999E+01-7.8850304E+01 3.4513500E+01
+-7.8843506E+01 3.4507198E+01-7.8846603E+01 3.4500702E+01
+-7.8854301E+01 3.4501499E+01-7.8866913E+01 3.4493755E+01
+-7.8868507E+01 3.4484531E+01-7.8871780E+01 3.4482498E+01
+ 319 160 225 220 99 1 7
+-7.7517929E+01 3.4439243E+01-7.7414665E+01 3.4492924E+01
+-7.7342224E+01 3.4524384E+01-7.7305046E+01 3.4544399E+01
+-7.7256371E+01 3.4578678E+01-7.7154350E+01 3.4628212E+01
+-7.7112900E+01 3.4640060E+01
+ 320 38194 219 225 99 102 11
+-7.7680862E+01 3.4720474E+01-7.7584450E+01 3.4500000E+01
+-7.7576523E+01 3.4476501E+01-7.7572510E+01 3.4476566E+01
+-7.7572067E+01 3.4472332E+01-7.7567535E+01 3.4469429E+01
+-7.7552773E+01 3.4470757E+01-7.7547356E+01 3.4465351E+01
+-7.7541672E+01 3.4464066E+01-7.7533798E+01 3.4458275E+01
+-7.7517929E+01 3.4439243E+01
+ 321 31410 226 223 101 102 31
+-7.8256592E+01 3.4399597E+01-7.8202164E+01 3.4444115E+01
+-7.8176773E+01 3.4465096E+01-7.8180367E+01 3.4465942E+01
+-7.8182442E+01 3.4469467E+01-7.8185707E+01 3.4467659E+01
+-7.8192833E+01 3.4473679E+01-7.8204109E+01 3.4476196E+01
+-7.8207649E+01 3.4487640E+01-7.8212265E+01 3.4485882E+01
+-7.8212624E+01 3.4488510E+01-7.8217621E+01 3.4487320E+01
+-7.8223068E+01 3.4492928E+01-7.8223701E+01 3.4490223E+01
+-7.8235985E+01 3.4492371E+01-7.8240990E+01 3.4498989E+01
+-7.8245796E+01 3.4499657E+01-7.8252785E+01 3.4504684E+01
+-7.8255791E+01 3.4508415E+01-7.8254326E+01 3.4511730E+01
+-7.8251701E+01 3.4510654E+01-7.8256233E+01 3.4513931E+01
+-7.8254738E+01 3.4519882E+01-7.8264442E+01 3.4520046E+01
+-7.8263580E+01 3.4524670E+01-7.8265770E+01 3.4526958E+01
+-7.8263382E+01 3.4528702E+01-7.8269218E+01 3.4530785E+01
+-7.8272507E+01 3.4537651E+01-7.8260696E+01 3.4545361E+01
+-7.8254906E+01 3.4553711E+01
+ 322 31300 226 224 103 101 26
+-7.8256592E+01 3.4399597E+01-7.8337524E+01 3.4366920E+01
+-7.8365280E+01 3.4372665E+01-7.8398262E+01 3.4371105E+01
+-7.8407501E+01 3.4373947E+01-7.8446144E+01 3.4376511E+01
+-7.8575325E+01 3.4428886E+01-7.8598343E+01 3.4432667E+01
+-7.8603310E+01 3.4440052E+01-7.8613480E+01 3.4442913E+01
+-7.8623238E+01 3.4453209E+01-7.8628441E+01 3.4451488E+01
+-7.8647118E+01 3.4458641E+01-7.8649338E+01 3.4458160E+01
+-7.8648781E+01 3.4454155E+01-7.8656982E+01 3.4450314E+01
+-7.8652245E+01 3.4457794E+01-7.8663490E+01 3.4460773E+01
+-7.8666954E+01 3.4463486E+01-7.8667908E+01 3.4469406E+01
+-7.8825378E+01 3.4461636E+01-7.8833839E+01 3.4463047E+01
+-7.8850426E+01 3.4473572E+01-7.8858109E+01 3.4474300E+01
+-7.8861351E+01 3.4482864E+01-7.8871780E+01 3.4482498E+01
+ 323 31370 227 226 103 102 17
+-7.8162560E+01 3.4356945E+01-7.8170670E+01 3.4356140E+01
+-7.8175331E+01 3.4351234E+01-7.8178917E+01 3.4354725E+01
+-7.8201530E+01 3.4352585E+01-7.8210892E+01 3.4358849E+01
+-7.8212166E+01 3.4369240E+01-7.8225471E+01 3.4373592E+01
+-7.8228989E+01 3.4378437E+01-7.8233391E+01 3.4373562E+01
+-7.8235680E+01 3.4374020E+01-7.8236664E+01 3.4379669E+01
+-7.8245819E+01 3.4384869E+01-7.8246552E+01 3.4392349E+01
+-7.8248009E+01 3.4393715E+01-7.8252838E+01 3.4391140E+01
+-7.8256592E+01 3.4399597E+01
+ 324 31631 228 227 105 102 26
+-7.8030205E+01 3.4331600E+01-7.8046989E+01 3.4330399E+01
+-7.8047630E+01 3.4335648E+01-7.8054146E+01 3.4335552E+01
+-7.8052834E+01 3.4339775E+01-7.8059731E+01 3.4345154E+01
+-7.8060143E+01 3.4337585E+01-7.8077888E+01 3.4338417E+01
+-7.8074928E+01 3.4347378E+01-7.8079475E+01 3.4354065E+01
+-7.8086205E+01 3.4351295E+01-7.8093422E+01 3.4352528E+01
+-7.8094818E+01 3.4355824E+01-7.8103043E+01 3.4354912E+01
+-7.8113472E+01 3.4360306E+01-7.8113281E+01 3.4363937E+01
+-7.8117569E+01 3.4364433E+01-7.8121742E+01 3.4368336E+01
+-7.8132607E+01 3.4366638E+01-7.8137016E+01 3.4371643E+01
+-7.8140915E+01 3.4368900E+01-7.8140457E+01 3.4365250E+01
+-7.8151619E+01 3.4366356E+01-7.8155495E+01 3.4364235E+01
+-7.8158302E+01 3.4358093E+01-7.8162560E+01 3.4356945E+01
+ 325 31276 224 229 103 100 68
+-7.8871780E+01 3.4482498E+01-7.8875000E+01 3.4478207E+01
+-7.8888283E+01 3.4470085E+01-7.8888641E+01 3.4466461E+01
+-7.8894768E+01 3.4461273E+01-7.8902382E+01 3.4456860E+01
+-7.8907265E+01 3.4454746E+01-7.8912788E+01 3.4456345E+01
+-7.8919075E+01 3.4452091E+01-7.8930084E+01 3.4454052E+01
+-7.8938148E+01 3.4451283E+01-7.8941612E+01 3.4452183E+01
+-7.8946838E+01 3.4448761E+01-7.8951790E+01 3.4448551E+01
+-7.8954193E+01 3.4443287E+01-7.8959885E+01 3.4442368E+01
+-7.8971107E+01 3.4427574E+01-7.8968697E+01 3.4425102E+01
+-7.8970139E+01 3.4423042E+01-7.8967781E+01 3.4422333E+01
+-7.8972092E+01 3.4417801E+01-7.8968201E+01 3.4416725E+01
+-7.8971291E+01 3.4410355E+01-7.8967583E+01 3.4410858E+01
+-7.8969765E+01 3.4405869E+01-7.8968636E+01 3.4397537E+01
+-7.8970062E+01 3.4395130E+01-7.8976006E+01 3.4395699E+01
+-7.8974014E+01 3.4391949E+01-7.8978355E+01 3.4390160E+01
+-7.8983368E+01 3.4393566E+01-7.8998375E+01 3.4391136E+01
+-7.9002541E+01 3.4384491E+01-7.9011856E+01 3.4380974E+01
+-7.9001228E+01 3.4364044E+01-7.9003990E+01 3.4361183E+01
+-7.9008270E+01 3.4361210E+01-7.9005928E+01 3.4359421E+01
+-7.9010956E+01 3.4355049E+01-7.9009544E+01 3.4352577E+01
+-7.9017143E+01 3.4351597E+01-7.9016945E+01 3.4349831E+01
+-7.9018745E+01 3.4351959E+01-7.9027542E+01 3.4352928E+01
+-7.9025452E+01 3.4348072E+01-7.9030525E+01 3.4347019E+01
+-7.9029243E+01 3.4342552E+01-7.9032387E+01 3.4342575E+01
+-7.9030838E+01 3.4340080E+01-7.9034729E+01 3.4338505E+01
+-7.9037689E+01 3.4333145E+01-7.9035286E+01 3.4329941E+01
+-7.9037132E+01 3.4325794E+01-7.9034210E+01 3.4324512E+01
+-7.9035728E+01 3.4319176E+01-7.9037109E+01 3.4321285E+01
+-7.9040649E+01 3.4317509E+01-7.9037773E+01 3.4316544E+01
+-7.9038681E+01 3.4313305E+01-7.9045364E+01 3.4310635E+01
+-7.9052704E+01 3.4314735E+01-7.9057976E+01 3.4310478E+01
+-7.9055328E+01 3.4308739E+01-7.9068298E+01 3.4306976E+01
+-7.9069923E+01 3.4305004E+01-7.9067802E+01 3.4303337E+01
+-7.9070618E+01 3.4303150E+01-7.9071419E+01 3.4299076E+01
+ 326 48173 222 229 100 1 2
+-7.9450264E+01 3.4620876E+01-7.9071419E+01 3.4299076E+01
+ 327 160 230 225 102 1 6
+-7.7716362E+01 3.4292637E+01-7.7661552E+01 3.4340408E+01
+-7.7647255E+01 3.4347080E+01-7.7580528E+01 3.4400459E+01
+-7.7533821E+01 3.4430965E+01-7.7517929E+01 3.4439243E+01
+ 328 46528 230 228 104 102 55
+-7.7716362E+01 3.4292637E+01-7.7718857E+01 3.4295059E+01
+-7.7726540E+01 3.4292301E+01-7.7733032E+01 3.4293922E+01
+-7.7738396E+01 3.4292061E+01-7.7741547E+01 3.4297573E+01
+-7.7740578E+01 3.4301422E+01-7.7752289E+01 3.4303230E+01
+-7.7805489E+01 3.4349552E+01-7.7812912E+01 3.4358833E+01
+-7.7814484E+01 3.4362911E+01-7.7812370E+01 3.4365025E+01
+-7.7815292E+01 3.4366703E+01-7.7809822E+01 3.4368832E+01
+-7.7804901E+01 3.4376747E+01-7.7810478E+01 3.4381897E+01
+-7.7815231E+01 3.4381508E+01-7.7818733E+01 3.4385605E+01
+-7.7821190E+01 3.4384918E+01-7.7823288E+01 3.4389191E+01
+-7.7844093E+01 3.4380692E+01-7.7858932E+01 3.4379528E+01
+-7.7871727E+01 3.4373169E+01-7.7880081E+01 3.4366127E+01
+-7.7887169E+01 3.4364098E+01-7.7895523E+01 3.4363602E+01
+-7.7899666E+01 3.4366047E+01-7.7900894E+01 3.4377789E+01
+-7.7909042E+01 3.4374767E+01-7.7917366E+01 3.4375561E+01
+-7.7929070E+01 3.4361378E+01-7.7932083E+01 3.4361359E+01
+-7.7931137E+01 3.4367279E+01-7.7934364E+01 3.4366848E+01
+-7.7935280E+01 3.4357857E+01-7.7941185E+01 3.4362511E+01
+-7.7940193E+01 3.4369663E+01-7.7949364E+01 3.4371326E+01
+-7.7951324E+01 3.4364334E+01-7.7959602E+01 3.4369698E+01
+-7.7961952E+01 3.4373264E+01-7.7959320E+01 3.4378670E+01
+-7.7960495E+01 3.4382515E+01-7.7969971E+01 3.4377865E+01
+-7.7975838E+01 3.4372177E+01-7.7984207E+01 3.4372913E+01
+-7.7987953E+01 3.4370975E+01-7.7988380E+01 3.4363712E+01
+-7.7978302E+01 3.4357822E+01-7.7979362E+01 3.4355282E+01
+-7.7987358E+01 3.4352688E+01-7.7994003E+01 3.4344593E+01
+-7.7995743E+01 3.4339905E+01-7.7993599E+01 3.4337025E+01
+-7.8030205E+01 3.4331600E+01
+ 329 31373 231 227 103 105 106
+-7.8650589E+01 3.3944073E+01-7.8647583E+01 3.3949688E+01
+-7.8644501E+01 3.3949871E+01-7.8646538E+01 3.3954201E+01
+-7.8642357E+01 3.3955917E+01-7.8643707E+01 3.3961525E+01
+-7.8646591E+01 3.3960220E+01-7.8648323E+01 3.3965237E+01
+-7.8640533E+01 3.3970249E+01-7.8633835E+01 3.3970196E+01
+-7.8630142E+01 3.3974686E+01-7.8625488E+01 3.3972092E+01
+-7.8624207E+01 3.3973228E+01-7.8627686E+01 3.3975529E+01
+-7.8626534E+01 3.3979599E+01-7.8631676E+01 3.3993191E+01
+-7.8640694E+01 3.4005001E+01-7.8639961E+01 3.4010502E+01
+-7.8625702E+01 3.4019272E+01-7.8619606E+01 3.4018204E+01
+-7.8617195E+01 3.4023037E+01-7.8612846E+01 3.4022053E+01
+-7.8613785E+01 3.4023930E+01-7.8611717E+01 3.4023197E+01
+-7.8609352E+01 3.4025581E+01-7.8606743E+01 3.4025375E+01
+-7.8607536E+01 3.4023682E+01-7.8603821E+01 3.4024437E+01
+-7.8603493E+01 3.4027367E+01-7.8600853E+01 3.4026340E+01
+-7.8600662E+01 3.4029888E+01-7.8600563E+01 3.4027737E+01
+-7.8594315E+01 3.4029156E+01-7.8590851E+01 3.4027096E+01
+-7.8588928E+01 3.4031998E+01-7.8583763E+01 3.4032089E+01
+-7.8585350E+01 3.4035934E+01-7.8579964E+01 3.4036415E+01
+-7.8578094E+01 3.4042828E+01-7.8582306E+01 3.4042553E+01
+-7.8583374E+01 3.4045158E+01-7.8580185E+01 3.4050774E+01
+-7.8573830E+01 3.4055580E+01-7.8571465E+01 3.4053200E+01
+-7.8569626E+01 3.4055901E+01-7.8568031E+01 3.4053429E+01
+-7.8562637E+01 3.4054207E+01-7.8561287E+01 3.4058990E+01
+-7.8557304E+01 3.4061943E+01-7.8559311E+01 3.4061508E+01
+-7.8559090E+01 3.4065903E+01-7.8555702E+01 3.4066776E+01
+-7.8554169E+01 3.4070988E+01-7.8555046E+01 3.4076553E+01
+-7.8558922E+01 3.4077328E+01-7.8557304E+01 3.4075382E+01
+-7.8559334E+01 3.4075016E+01-7.8563080E+01 3.4077076E+01
+-7.8561340E+01 3.4081932E+01-7.8557495E+01 3.4083076E+01
+-7.8560181E+01 3.4091591E+01-7.8557190E+01 3.4091549E+01
+-7.8558899E+01 3.4093105E+01-7.8553665E+01 3.4096745E+01
+-7.8552513E+01 3.4094887E+01-7.8549042E+01 3.4095253E+01
+-7.8544609E+01 3.4099304E+01-7.8547607E+01 3.4099922E+01
+-7.8546669E+01 3.4102444E+01-7.8549423E+01 3.4103840E+01
+-7.8554161E+01 3.4103378E+01-7.8549675E+01 3.4111465E+01
+-7.8551430E+01 3.4114643E+01-7.8553780E+01 3.4112766E+01
+-7.8555557E+01 3.4116524E+01-7.8549347E+01 3.4118443E+01
+-7.8551163E+01 3.4122131E+01-7.8548370E+01 3.4125645E+01
+-7.8543175E+01 3.4126228E+01-7.8540199E+01 3.4122883E+01
+-7.8539154E+01 3.4124504E+01-7.8546066E+01 3.4134491E+01
+-7.8543945E+01 3.4137997E+01-7.8546997E+01 3.4138203E+01
+-7.8545380E+01 3.4140377E+01-7.8544746E+01 3.4146099E+01
+-7.8541191E+01 3.4148026E+01-7.8537773E+01 3.4145706E+01
+-7.8532814E+01 3.4153629E+01-7.8526321E+01 3.4154083E+01
+-7.8518883E+01 3.4158894E+01-7.8515739E+01 3.4165939E+01
+-7.8503456E+01 3.4167789E+01-7.8495201E+01 3.4166603E+01
+-7.8485909E+01 3.4158386E+01-7.8478424E+01 3.4158897E+01
+-7.8460518E+01 3.4149998E+01-7.8422859E+01 3.4139053E+01
+-7.8392776E+01 3.4173153E+01-7.8373924E+01 3.4187866E+01
+-7.8367065E+01 3.4188602E+01-7.8374504E+01 3.4204857E+01
+-7.8254753E+01 3.4216148E+01-7.8235809E+01 3.4248276E+01
+-7.8228271E+01 3.4256481E+01-7.8162560E+01 3.4356945E+01
+ 330 36054 229 231 103 1 2
+-7.9071419E+01 3.4299076E+01-7.8650589E+01 3.3944073E+01
+ 331 160 232 230 104 1 8
+-7.7936729E+01 3.3927631E+01-7.7915123E+01 3.3969601E+01
+-7.7894142E+01 3.4025841E+01-7.7850296E+01 3.4117352E+01
+-7.7837906E+01 3.4148808E+01-7.7778801E+01 3.4226971E+01
+-7.7743538E+01 3.4268917E+01-7.7716362E+01 3.4292637E+01
+ 332 31637 232 228 105 104 39
+-7.7936729E+01 3.3927631E+01-7.7948799E+01 3.3970699E+01
+-7.7941505E+01 3.3983002E+01-7.7935616E+01 3.4007957E+01
+-7.7931229E+01 3.4050625E+01-7.7937210E+01 3.4122650E+01
+-7.7952499E+01 3.4150177E+01-7.7958900E+01 3.4173599E+01
+-7.7957954E+01 3.4188030E+01-7.7954102E+01 3.4194500E+01
+-7.7961998E+01 3.4203201E+01-7.7951790E+01 3.4232189E+01
+-7.7958107E+01 3.4234261E+01-7.7962227E+01 3.4239304E+01
+-7.7955711E+01 3.4239475E+01-7.7957603E+01 3.4241199E+01
+-7.7968803E+01 3.4242199E+01-7.7969803E+01 3.4243900E+01
+-7.7965302E+01 3.4249100E+01-7.7968102E+01 3.4251999E+01
+-7.7973396E+01 3.4247101E+01-7.7979103E+01 3.4259899E+01
+-7.7987999E+01 3.4259899E+01-7.7987801E+01 3.4268101E+01
+-7.8002304E+01 3.4272900E+01-7.7999603E+01 3.4276001E+01
+-7.7991707E+01 3.4277901E+01-7.7990501E+01 3.4281502E+01
+-7.7996803E+01 3.4284199E+01-7.8005104E+01 3.4280300E+01
+-7.8006203E+01 3.4288700E+01-7.8016197E+01 3.4290100E+01
+-7.8015106E+01 3.4307301E+01-7.8006531E+01 3.4319344E+01
+-7.8008942E+01 3.4322384E+01-7.8013008E+01 3.4323009E+01
+-7.8026321E+01 3.4317825E+01-7.8026207E+01 3.4328354E+01
+-7.8030205E+01 3.4331600E+01
+ 333 31580 231 233 105 1 2
+-7.8650589E+01 3.3944073E+01-7.8543106E+01 3.3850632E+01
+ 334 160 233 232 105 1 15
+-7.8543106E+01 3.3850632E+01-7.8541359E+01 3.3850941E+01
+-7.8506439E+01 3.3865322E+01-7.8358414E+01 3.3902916E+01
+-7.8262085E+01 3.3912315E+01-7.8162621E+01 3.3913097E+01
+-7.8073761E+01 3.3900894E+01-7.8023781E+01 3.3886669E+01
+-7.8009491E+01 3.3868557E+01-7.8009491E+01 3.3858067E+01
+-7.7985657E+01 3.3848537E+01-7.7958008E+01 3.3830425E+01
+-7.7957054E+01 3.3878090E+01-7.7948479E+01 3.3904781E+01
+-7.7936729E+01 3.3927631E+01
+ -1 0 0 0 0 0 0
+CNT 2
+ 0-7.9332649E+01 3.5538574E+01
+ 1-8.1501175E+01 3.6434513E+01
+ 1
+ 1-8.1128891E+01 3.6491341E+01
+ 2
+ 1-8.0688377E+01 3.6414612E+01
+ 3
+ 1-7.6700920E+01 3.6444778E+01
+ 4
+ 1-7.6003372E+01 3.6400658E+01
+ 5
+ 1-7.6190048E+01 3.6371758E+01
+ 6
+ 1-8.0239769E+01 3.6401676E+01
+ 7
+ 1-7.7396988E+01 3.6417633E+01
+ 8
+ 1-7.6981026E+01 3.6358402E+01
+ 9
+ 1-7.8107033E+01 3.6396442E+01
+ 10
+ 1-7.8408691E+01 3.6364544E+01
+ 11
+ 1-7.9775444E+01 3.6395782E+01
+ 12
+ 1-7.8653259E+01 3.6303726E+01
+ 13
+ 1-7.9333786E+01 3.6393162E+01
+ 14
+ 1-7.8971771E+01 3.6389751E+01
+ 15
+ 1-7.7652191E+01 3.6257378E+01
+ 16
+ 1-7.6272270E+01 3.6288277E+01
+ 17
+ 1-8.1164024E+01 3.6206413E+01
+ 18
+ 1-8.1697197E+01 3.6231171E+01
+ 19
+ 1-7.6433128E+01 3.6199905E+01
+ 20
+ 1-7.6615417E+01 3.6149204E+01
+ 21
+ 1-8.0665611E+01 3.6160355E+01
+ 22
+ 1-8.1922523E+01 3.6076283E+01
+ 23
+ 1-7.8285919E+01 3.6082630E+01
+ 24
+ 1-8.0256561E+01 3.6130264E+01
+ 25
+ 1-7.9789261E+01 3.6079300E+01
+ 26
+ 1-7.9399590E+01 3.6043663E+01
+ 27
+ 1-7.6972473E+01 3.6066944E+01
+ 28
+ 1-7.9120773E+01 3.6061108E+01
+ 29
+ 1-7.8876633E+01 3.6035675E+01
+ 30
+ 1-7.5673363E+01 3.6003674E+01
+ 31
+ 1-7.7986809E+01 3.5967236E+01
+ 32
+ 1-8.2163551E+01 3.6013054E+01
+ 33
+ 1-7.7597511E+01 3.5912766E+01
+ 34
+ 1-8.1546654E+01 3.5952782E+01
+ 35
+ 1-8.2307922E+01 3.5898838E+01
+ 36
+ 1-7.8650574E+01 3.5790035E+01
+ 37
+ 1-7.7106567E+01 3.5840912E+01
+ 38
+ 1-8.2705902E+01 3.5857956E+01
+ 39
+ 1-8.0544731E+01 3.5929127E+01
+ 40
+ 1-8.0873344E+01 3.5809082E+01
+ 41
+ 1-8.1177376E+01 3.5920952E+01
+ 42
+ 1-8.0212624E+01 3.5792850E+01
+ 43
+ 1-8.1704918E+01 3.5749367E+01
+ 44
+ 1-7.6196083E+01 3.5817509E+01
+ 45
+ 1-7.6575981E+01 3.5822586E+01
+ 46
+ 1-7.5863617E+01 3.5776630E+01
+ 47
+ 1-8.2048904E+01 3.5681042E+01
+ 48
+ 1-7.5658241E+01 3.5877846E+01
+ 49
+ 1-7.9805992E+01 3.5710125E+01
+ 50
+ 1-7.9255699E+01 3.5702515E+01
+ 51
+ 1-7.7918816E+01 3.5704666E+01
+ 52
+ 1-8.0525055E+01 3.5639561E+01
+ 53
+ 1-7.7374931E+01 3.5593422E+01
+ 54
+ 1-8.1214973E+01 3.5662415E+01
+ 55
+ 1-8.2530228E+01 3.5611095E+01
+ 56
+ 1-7.8366051E+01 3.5517586E+01
+ 57
+ 1-8.2982353E+01 3.5555908E+01
+ 58
+ 1-7.5538177E+01 3.5421303E+01
+ 59
+ 1-7.6849289E+01 3.5487129E+01
+ 60
+ 1-7.6257545E+01 3.5531116E+01
+ 61
+ 1-8.3492752E+01 3.5486752E+01
+ 62
+ 1-7.7675987E+01 3.5485004E+01
+ 63
+ 1-7.9172249E+01 3.5474854E+01
+ 64
+ 1-8.1920357E+01 3.5402214E+01
+ 65
+ 1-7.8004463E+01 3.5363499E+01
+ 66
+ 1-8.1555801E+01 3.5333817E+01
+ 67
+ 1-7.8869728E+01 3.5368652E+01
+ 68
+ 1-8.1223679E+01 3.5485657E+01
+ 69
+ 1-8.3140991E+01 3.5287117E+01
+ 70
+ 1-8.0833847E+01 3.5248745E+01
+ 71
+ 1-7.9481804E+01 3.5310608E+01
+ 72
+ 1-7.9905914E+01 3.5332130E+01
+ 73
+ 1-8.0551804E+01 3.5386612E+01
+ 74
+ 1-8.0250809E+01 3.5311836E+01
+ 75
+ 1-8.2479889E+01 3.5336124E+01
+ 76
+ 1-8.3833427E+01 3.5350044E+01
+ 77
+ 1-7.7641846E+01 3.5238934E+01
+ 78
+ 1-8.2798264E+01 3.5202190E+01
+ 79
+ 1-8.1180367E+01 3.5293961E+01
+ 80
+ 1-7.7081390E+01 3.5121651E+01
+ 81
+ 1-8.2169746E+01 3.5279312E+01
+ 82
+ 1-7.6736877E+01 3.5133934E+01
+ 83
+ 1-8.3422348E+01 3.5150429E+01
+ 84
+ 1-7.8371567E+01 3.4991444E+01
+ 85
+ 1-8.4063499E+01 3.5133801E+01
+ 86
+ 1-7.8827576E+01 3.5048340E+01
+ 87
+ 1-7.7355621E+01 3.5022209E+01
+ 88
+ 1-7.9237251E+01 3.5017109E+01
+ 89
+ 1-8.0102959E+01 3.4973537E+01
+ 90
+ 1-8.0531029E+01 3.4988300E+01
+ 91
+ 1-7.5900093E+01 3.5134480E+01
+ 92
+ 1-7.7933670E+01 3.4936165E+01
+ 93
+ 1-7.9748245E+01 3.5005898E+01
+ 94
+ 1-8.3750336E+01 3.5057014E+01
+ 95
+ 1-7.6631920E+01 3.4826519E+01
+ 96
+ 1-7.9480698E+01 3.4840866E+01
+ 97
+ 1-7.7428261E+01 3.4729675E+01
+ 98
+ 1-7.9103889E+01 3.4639885E+01
+ 99
+ 1-7.8563438E+01 3.4614189E+01
+ 100
+ 1-7.7905449E+01 3.4524101E+01
+ 101
+ 1-7.8655487E+01 3.4265190E+01
+ 102
+ 1-7.7884842E+01 3.4230663E+01
+ 103
+ 1-7.8237770E+01 3.4069454E+01
+ 104
+ -1 0 0 0 0 0 0
+LAB 2
+ 1991 2-8.1483864E+01 3.6437286E+01
+-8.1483864E+01 3.6437286E+01-8.1483864E+01 3.6437286E+01
+ 1983 3-8.1144035E+01 3.6485950E+01
+-8.1144035E+01 3.6485950E+01-8.1144035E+01 3.6485950E+01
+ 1965 4-8.0707527E+01 3.6422901E+01
+-8.0707527E+01 3.6422901E+01-8.0707527E+01 3.6422901E+01
+ 1847 5-7.6697113E+01 3.6453075E+01
+-7.6697113E+01 3.6453075E+01-7.6697113E+01 3.6453075E+01
+ 1818 6-7.5929359E+01 3.6341240E+01
+-7.5929359E+01 3.6341240E+01-7.5929359E+01 3.6341240E+01
+ 1839 7-7.6115868E+01 3.6340492E+01
+-7.6115868E+01 3.6340492E+01-7.6115868E+01 3.6340492E+01
+ 1957 8-8.0238640E+01 3.6422691E+01
+-8.0238640E+01 3.6422691E+01-8.0238640E+01 3.6422691E+01
+ 1866 9-7.7386650E+01 3.6404781E+01
+-7.7386650E+01 3.6404781E+01-7.7386650E+01 3.6404781E+01
+ 1862 10-7.6928902E+01 3.6308956E+01
+-7.6928902E+01 3.6308956E+01-7.6928902E+01 3.6308956E+01
+ 1892 11-7.8108421E+01 3.6415543E+01
+-7.8108421E+01 3.6415543E+01-7.8108421E+01 3.6415543E+01
+ 1910 12-7.8400154E+01 3.6379608E+01
+-7.8400154E+01 3.6379608E+01-7.8400154E+01 3.6379608E+01
+ 1944 13-7.9777199E+01 3.6421608E+01
+-7.9777199E+01 3.6421608E+01-7.9777199E+01 3.6421608E+01
+ 1912 14-7.8655304E+01 3.6337532E+01
+-7.8655304E+01 3.6337532E+01-7.8655304E+01 3.6337532E+01
+ 1935 15-7.9333923E+01 3.6417088E+01
+-7.9333923E+01 3.6417088E+01-7.9333923E+01 3.6417088E+01
+ 1924 16-7.8971420E+01 3.6412975E+01
+-7.8971420E+01 3.6412975E+01-7.8971420E+01 3.6412975E+01
+ 1898 17-7.7654610E+01 3.6288399E+01
+-7.7654610E+01 3.6288399E+01-7.7654610E+01 3.6288399E+01
+ 1854 18-7.6296692E+01 3.6304756E+01
+-7.6296692E+01 3.6304756E+01-7.6296692E+01 3.6304756E+01
+ 2014 19-8.1152252E+01 3.6237007E+01
+-8.1152252E+01 3.6237007E+01-8.1152252E+01 3.6237007E+01
+ 2037 20-8.1696251E+01 3.6260208E+01
+-8.1696251E+01 3.6260208E+01-8.1696251E+01 3.6260208E+01
+ 1875 21-7.6376244E+01 3.6129433E+01
+-7.6376244E+01 3.6129433E+01-7.6376244E+01 3.6129433E+01
+ 1887 22-7.6561226E+01 3.6088554E+01
+-7.6561226E+01 3.6088554E+01-7.6561226E+01 3.6088554E+01
+ 2029 23-8.0659073E+01 3.6180038E+01
+-8.0659073E+01 3.6180038E+01-8.0659073E+01 3.6180038E+01
+ 2053 24-8.1909508E+01 3.6117977E+01
+-8.1909508E+01 3.6117977E+01-8.1909508E+01 3.6117977E+01
+ 1961 25-7.8319687E+01 3.6080048E+01
+-7.8319687E+01 3.6080048E+01-7.8319687E+01 3.6080048E+01
+ 2021 26-8.0239098E+01 3.6138756E+01
+-8.0239098E+01 3.6138756E+01-8.0239098E+01 3.6138756E+01
+ 2010 27-7.9789001E+01 3.6105145E+01
+-7.9789001E+01 3.6105145E+01-7.9789001E+01 3.6105145E+01
+ 2002 28-7.9400490E+01 3.6070801E+01
+-7.9400490E+01 3.6070801E+01-7.9400490E+01 3.6070801E+01
+ 1917 29-7.6970917E+01 3.6084442E+01
+-7.6970917E+01 3.6084442E+01-7.6970917E+01 3.6084442E+01
+ 1993 30-7.9120499E+01 3.6085812E+01
+-7.9120499E+01 3.6085812E+01-7.9120499E+01 3.6085812E+01
+ 1988 31-7.8865677E+01 3.6068008E+01
+-7.8865677E+01 3.6068008E+01-7.8865677E+01 3.6068008E+01
+ 1885 32-7.5703217E+01 3.6036343E+01
+-7.5703217E+01 3.6036343E+01-7.5703217E+01 3.6036343E+01
+ 1969 33-7.7967354E+01 3.5975140E+01
+-7.7967354E+01 3.5975140E+01-7.7967354E+01 3.5975140E+01
+ 2094 34-8.2126480E+01 3.6005745E+01
+-8.2126480E+01 3.6005745E+01-8.2126480E+01 3.6005745E+01
+ 1967 35-7.7565224E+01 3.5928608E+01
+-7.7565224E+01 3.5928608E+01-7.7565224E+01 3.5928608E+01
+ 2088 36-8.1561554E+01 3.5969551E+01
+-8.1561554E+01 3.5969551E+01-8.1561554E+01 3.5969551E+01
+ 2107 37-8.2318336E+01 3.5916180E+01
+-8.2318336E+01 3.5916180E+01-8.2318336E+01 3.5916180E+01
+ 2019 38-7.8617790E+01 3.5819622E+01
+-7.8617790E+01 3.5819622E+01-7.8617790E+01 3.5819622E+01
+ 1974 39-7.7088074E+01 3.5787594E+01
+-7.7088074E+01 3.5787594E+01-7.7088074E+01 3.5787594E+01
+ 2116 40-8.2666069E+01 3.5887177E+01
+-8.2666069E+01 3.5887177E+01-8.2666069E+01 3.5887177E+01
+ 2060 41-8.0537743E+01 3.5932270E+01
+-8.0537743E+01 3.5932270E+01-8.0537743E+01 3.5932270E+01
+ 2074 42-8.0886955E+01 3.5827644E+01
+-8.0886955E+01 3.5827644E+01-8.0886955E+01 3.5827644E+01
+ 2089 43-8.1178024E+01 3.5938282E+01
+-8.1178024E+01 3.5938282E+01-8.1178024E+01 3.5938282E+01
+ 2059 44-8.0241394E+01 3.5807896E+01
+-8.0241394E+01 3.5807896E+01-8.0241394E+01 3.5807896E+01
+ 2114 45-8.1662407E+01 3.5789024E+01
+-8.1662407E+01 3.5789024E+01-8.1662407E+01 3.5789024E+01
+ 1950 46-7.6191864E+01 3.5902309E+01
+-7.6191864E+01 3.5902309E+01-7.6191864E+01 3.5902309E+01
+ 1960 47-7.6544334E+01 3.5877998E+01
+-7.6544334E+01 3.5877998E+01-7.6544334E+01 3.5877998E+01
+ 1943 48-7.5724220E+01 3.5761356E+01
+-7.5724220E+01 3.5761356E+01-7.5724220E+01 3.5761356E+01
+ 2120 49-8.2064499E+01 3.5652943E+01
+-8.2064499E+01 3.5652943E+01-8.2064499E+01 3.5652943E+01
+ 1947 50-7.5647957E+01 3.5875854E+01
+-7.5647957E+01 3.5875854E+01-7.5647957E+01 3.5875854E+01
+ 2072 51-7.9801651E+01 3.5731339E+01
+-7.9801651E+01 3.5731339E+01-7.9801651E+01 3.5731339E+01
+ 2056 52-7.9257042E+01 3.5722939E+01
+-7.9257042E+01 3.5722939E+01-7.9257042E+01 3.5722939E+01
+ 2034 53-7.7891891E+01 3.5737320E+01
+-7.7891891E+01 3.5737320E+01-7.7891891E+01 3.5737320E+01
+ 2110 54-8.0531204E+01 3.5683529E+01
+-8.0531204E+01 3.5683529E+01-8.0531204E+01 3.5683529E+01
+ 2028 55-7.7398834E+01 3.5615345E+01
+-7.7398834E+01 3.5615345E+01-7.7398834E+01 3.5615345E+01
+ 2129 56-8.1195396E+01 3.5622734E+01
+-8.1195396E+01 3.5622734E+01-8.1195396E+01 3.5622734E+01
+ 2158 57-8.2568977E+01 3.5651436E+01
+-8.2568977E+01 3.5651436E+01-8.2568977E+01 3.5651436E+01
+ 2048 58-7.8342026E+01 3.5572041E+01
+-7.8342026E+01 3.5572041E+01-7.8342026E+01 3.5572041E+01
+ 2183 59-8.2979912E+01 3.5576195E+01
+-8.2979912E+01 3.5576195E+01-8.2979912E+01 3.5576195E+01
+ 1973 60-7.5508514E+01 3.5340122E+01
+-7.5508514E+01 3.5340122E+01-7.5508514E+01 3.5340122E+01
+ 2031 61-7.6839005E+01 3.5508736E+01
+-7.6839005E+01 3.5508736E+01-7.6839005E+01 3.5508736E+01
+ 2013 62-7.6189987E+01 3.5419750E+01
+-7.6189987E+01 3.5419750E+01-7.6189987E+01 3.5419750E+01
+ 2201 63-8.3532944E+01 3.5524010E+01
+-8.3532944E+01 3.5524010E+01-8.3532944E+01 3.5524010E+01
+ 2063 64-7.7662819E+01 3.5514061E+01
+-7.7662819E+01 3.5514061E+01-7.7662819E+01 3.5514061E+01
+ 2115 65-7.9186523E+01 3.5492950E+01
+-7.9186523E+01 3.5492950E+01-7.9186523E+01 3.5492950E+01
+ 2188 66-8.1970367E+01 3.5440533E+01
+-8.1970367E+01 3.5440533E+01-8.1970367E+01 3.5440533E+01
+ 2091 67-7.8023216E+01 3.5306583E+01
+-7.8023216E+01 3.5306583E+01-7.8023216E+01 3.5306583E+01
+ 2189 68-8.1523712E+01 3.5279194E+01
+-8.1523712E+01 3.5279194E+01-8.1523712E+01 3.5279194E+01
+ 2117 69-7.8801338E+01 3.5383560E+01
+-7.8801338E+01 3.5383560E+01-7.8801338E+01 3.5383560E+01
+ 2184 70-8.1228767E+01 3.5498150E+01
+-8.1228767E+01 3.5498150E+01-8.1228767E+01 3.5498150E+01
+ 2226 71-8.3120583E+01 3.5289394E+01
+-8.3120583E+01 3.5289394E+01-8.3120583E+01 3.5289394E+01
+ 2185 72-8.0830345E+01 3.5288261E+01
+-8.0830345E+01 3.5288261E+01-8.0830345E+01 3.5288261E+01
+ 2137 73-7.9466995E+01 3.5319210E+01
+-7.9466995E+01 3.5319210E+01-7.9466995E+01 3.5319210E+01
+ 2150 74-7.9884148E+01 3.5346886E+01
+-7.9884148E+01 3.5346886E+01-7.9884148E+01 3.5346886E+01
+ 2172 75-8.0573700E+01 3.5388443E+01
+-8.0573700E+01 3.5388443E+01-8.0573700E+01 3.5388443E+01
+ 2168 76-8.0232948E+01 3.5345451E+01
+-8.0232948E+01 3.5345451E+01-8.0232948E+01 3.5345451E+01
+ 2213 77-8.2499825E+01 3.5351288E+01
+-8.2499825E+01 3.5351288E+01-8.2499825E+01 3.5351288E+01
+ 2257 78-8.3838470E+01 3.5350296E+01
+-8.3838470E+01 3.5350296E+01-8.3838470E+01 3.5350296E+01
+ 2104 79-7.7676346E+01 3.5257153E+01
+-7.7676346E+01 3.5257153E+01-7.7676346E+01 3.5257153E+01
+ 2244 80-8.2763725E+01 3.5238647E+01
+-8.2763725E+01 3.5238647E+01-8.2763725E+01 3.5238647E+01
+ 2203 81-8.1184471E+01 3.5305099E+01
+-8.1184471E+01 3.5305099E+01-8.1184471E+01 3.5305099E+01
+ 2100 82-7.7199776E+01 3.5168358E+01
+-7.7199776E+01 3.5168358E+01-7.7199776E+01 3.5168358E+01
+ 2224 83-8.2158211E+01 3.5301922E+01
+-8.2158211E+01 3.5301922E+01-8.2158211E+01 3.5301922E+01
+ 2099 84-7.6682793E+01 3.5180840E+01
+-7.6682793E+01 3.5180840E+01-7.6682793E+01 3.5180840E+01
+ 2270 85-8.3467758E+01 3.5189499E+01
+-8.3467758E+01 3.5189499E+01-8.3467758E+01 3.5189499E+01
+ 2155 86-7.8401535E+01 3.4983139E+01
+-7.8401535E+01 3.4983139E+01-7.8401535E+01 3.4983139E+01
+ 2282 87-8.4080681E+01 3.5151241E+01
+-8.4080681E+01 3.5151241E+01-8.4080681E+01 3.5151241E+01
+ 2175 88-7.8881691E+01 3.5088646E+01
+-7.8881691E+01 3.5088646E+01-7.8881691E+01 3.5088646E+01
+ 2138 89-7.7350716E+01 3.5036774E+01
+-7.7350716E+01 3.5036774E+01-7.7350716E+01 3.5036774E+01
+ 2195 90-7.9252548E+01 3.5043896E+01
+-7.9252548E+01 3.5043896E+01-7.9252548E+01 3.5043896E+01
+ 2219 91-8.0080612E+01 3.5010700E+01
+-8.0080612E+01 3.5010700E+01-8.0080612E+01 3.5010700E+01
+ 2223 92-8.0516899E+01 3.5032787E+01
+-8.0516899E+01 3.5032787E+01-8.0516899E+01 3.5032787E+01
+ 2098 93-7.5887108E+01 3.5142582E+01
+-7.5887108E+01 3.5142582E+01-7.5887108E+01 3.5142582E+01
+ 2164 94-7.7902687E+01 3.4962505E+01
+-7.7902687E+01 3.4962505E+01-7.7902687E+01 3.4962505E+01
+ 2209 95-7.9731300E+01 3.5006870E+01
+-7.9731300E+01 3.5006870E+01-7.9731300E+01 3.5006870E+01
+ 2295 96-8.3742851E+01 3.5025101E+01
+-8.3742851E+01 3.5025101E+01-8.3742851E+01 3.5025101E+01
+ 2130 97-7.6434547E+01 3.4904079E+01
+-7.6434547E+01 3.4904079E+01-7.6434547E+01 3.4904079E+01
+ 2228 98-7.9470993E+01 3.4863567E+01
+-7.9470993E+01 3.4863567E+01-7.9470993E+01 3.4863567E+01
+ 2193 99-7.7394218E+01 3.4703533E+01
+-7.7394218E+01 3.4703533E+01-7.7394218E+01 3.4703533E+01
+ 2236 100-7.9106850E+01 3.4674904E+01
+-7.9106850E+01 3.4674904E+01-7.9106850E+01 3.4674904E+01
+ 2246 101-7.8563866E+01 3.4659603E+01
+-7.8563866E+01 3.4659603E+01-7.8563866E+01 3.4659603E+01
+ 2249 102-7.7901207E+01 3.4550785E+01
+-7.7901207E+01 3.4550785E+01-7.7901207E+01 3.4550785E+01
+ 2313 103-7.8719734E+01 3.4248161E+01
+-7.8719734E+01 3.4248161E+01-7.8719734E+01 3.4248161E+01
+ 2296 104-7.7846992E+01 3.4277313E+01
+-7.7846992E+01 3.4277313E+01-7.7846992E+01 3.4277313E+01
+ 2318 105-7.8275612E+01 3.3969875E+01
+-7.8275612E+01 3.3969875E+01-7.8275612E+01 3.3969875E+01
+ -1 0 0.0000000E+00 0.0000000E+00
+PAL 2
+ 101-8.4321953E+01 3.3830425E+01-7.5461288E+01 3.6588001E+01
+ 0 0 0 1 2 2
+ 33 1 2 40 34 20
+ 42 39 24 80 41 24
+ 81 67 34 83 61 34
+ 102 69 37 107 82 40
+ -110 76 40 -136 88 40
+ -147 106 59 154 112 59
+ 173 117 63 197 128 63
+ 198 147 78 219 146 78
+ -233 161 87 282 170 87
+ 283 202 87 286 203 87
+ 284 205 96 287 204 96
+ 281 201 96 -279 200 85
+ 277 199 71 270 195 80
+ 266 193 80 264 192 80
+ 259 189 77 244 175 83
+ 239 173 83 245 177 66
+ 247 180 66 250 181 68
+ 253 184 68 256 186 81
+ 267 188 72 276 191 72
+ 299 198 92 301 213 92
+ 303 214 91 305 215 95
+ 313 216 98 314 221 100
+ 326 222 100 330 229 103
+ 333 231 105 334 233 105
+ 331 232 104 327 230 102
+ 319 225 99 315 220 97
+ 272 196 84 212 157 61
+ 215 154 62 170 126 48
+ 114 91 46 109 86 47
+ 108 87 29 97 77 22
+ 86 71 21 76 65 18
+ 73 60 7 84 62 6
+ 139 56 32 63 55 6
+ 7 7 6 8 11 6
+ 6 10 7 9 8 7
+ 10 12 5 16 6 5
+ -17 19 10 -11 13 9
+ 12 15 9 -13 14 9
+ -14 16 11 -15 17 11
+ -20 18 12 -26 22 14
+ 22 23 14 23 26 16
+ 24 25 15 25 27 15
+ 27 28 15 28 29 15
+ 29 30 13 21 24 13
+ -18 20 8 19 21 8
+ 5 9 4 -4 5 4
+ -3 4 4 2 3 3
+ 0 0 0 134 104 50
+ 0 0 0 240 178 60
+ 265 171 93
+ 5-8.1741882E+01 3.6240067E+01-8.1244392E+01 3.6588001E+01
+ 36 2 3 -55 36 19
+ 56 51 20 -33 34 1
+ -1 1 1
+ 4-8.1355164E+01 3.6363235E+01-8.0901932E+01 3.6574600E+01
+ 32 3 4 35 33 19
+ -36 36 2 -2 2 1
+ 8-8.0976280E+01 3.6236248E+01-8.0440323E+01 3.6562187E+01
+ 3 3 1 4 4 1
+ -5 5 1 -43 9 8
+ 54 42 26 59 50 23
+ -60 53 19 -32 33 3
+ 7-7.6950882E+01 3.6296055E+01-7.6454025E+01 3.6551941E+01
+ 30 12 7 -34 31 18
+ 37 35 21 38 37 22
+ -39 38 10 -16 19 1
+ -10 6 1
+ 6-7.6313553E+01 3.6070065E+01-7.5773750E+01 3.6550755E+01
+ -63 7 1 64 55 32
+ -84 56 1 -72 62 7
+ -8 10 1 -7 11 1
+ 6-7.6542015E+01 3.6154503E+01-7.5888496E+01 3.6550560E+01
+ 72 10 6 -73 62 1
+ -71 60 18 -30 31 5
+ -9 12 1 -6 8 1
+ 5-8.0452171E+01 3.6257259E+01-8.0027504E+01 3.6550495E+01
+ 18 21 1 44 20 13
+ 45 43 26 43 42 4
+ -19 9 1
+ 7-7.7900063E+01 3.6164810E+01-7.7066498E+01 3.6546181E+01
+ 11 15 1 47 13 10
+ 68 45 29 -69 59 17
+ -31 32 11 13 16 1
+ -12 14 1
+ 5-7.7209106E+01 3.6238079E+01-7.6689789E+01 3.6546181E+01
+ 17 13 1 39 19 5
+ 49 38 22 58 47 29
+ -47 45 9
+ 6-7.8324188E+01 3.6202530E+01-7.7898239E+01 3.6544518E+01
+ 14 17 1 31 16 9
+ 65 32 17 66 57 25
+ 41 40 12 15 18 1
+ 4-7.8511574E+01 3.6163509E+01-7.8277763E+01 3.6543667E+01
+ 20 22 1 -41 18 11
+ -70 40 25 67 58 14
+ 6-8.0035774E+01 3.6241299E+01-7.9510895E+01 3.6542355E+01
+ -29 24 1 -46 30 15
+ 52 44 28 53 49 27
+ -44 43 8 -21 20 1
+ 7-7.8807831E+01 3.6021656E+01-7.8453766E+01 3.6542332E+01
+ 26 23 1 -67 22 12
+ -94 58 25 -95 78 38
+ -85 70 31 -61 54 16
+ -22 26 1
+ 8-7.9532219E+01 3.6241982E+01-7.9138199E+01 3.6541599E+01
+ 50 25 16 -51 48 30
+ 48 46 28 46 44 13
+ -28 30 1 -27 29 1
+ -25 28 1 -24 27 1
+ 5-7.9153999E+01 3.6235798E+01-7.8795097E+01 3.6541599E+01
+ 61 26 14 62 54 31
+ 57 52 30 -50 48 15
+ -23 25 1
+ 6-7.8006844E+01 3.6003284E+01-7.7230598E+01 3.6511887E+01
+ 69 32 9 -82 59 29
+ -98 68 39 99 80 35
+ -74 63 33 -65 57 11
+ 4-7.6491806E+01 3.6113159E+01-7.6032944E+01 3.6510384E+01
+ 34 35 5 71 31 7
+ -76 60 1 -77 65 21
+ 8-8.1545631E+01 3.5994659E+01-8.0869087E+01 3.6437584E+01
+ 60 33 4 88 53 23
+ 92 72 42 -101 75 43
+ 100 81 36 75 64 20
+ 55 51 2 -35 36 3
+ 5-8.1918335E+01 3.6111416E+01-8.1461365E+01 3.6391041E+01
+ -56 34 2 -75 51 19
+ -78 64 36 79 66 24
+ -40 39 1
+ 4-7.6590202E+01 3.6067844E+01-7.6184258E+01 3.6377888E+01
+ 77 35 18 -86 65 1
+ 87 71 22 -37 37 5
+ 5-7.6737671E+01 3.6007343E+01-7.6403259E+01 3.6351181E+01
+ -87 37 21 -97 71 1
+ 93 77 29 -49 47 10
+ -38 38 5
+ 5-8.0882385E+01 3.6046398E+01-8.0432190E+01 3.6287552E+01
+ 90 50 26 91 74 41
+ 89 73 42 -88 72 19
+ -59 53 4
+ 7-8.2080597E+01 3.5911396E+01-8.1735695E+01 3.6286903E+01
+ -79 39 20 -105 66 36
+ 106 84 45 -112 85 49
+ -113 90 34 -80 67 1
+ -42 41 1
+ 5-7.8546776E+01 3.5817451E+01-7.8006844E+01 3.6265949E+01
+ 131 57 33 -132 103 38
+ 94 78 14 70 58 12
+ -66 40 11
+ 6-8.0516640E+01 3.5972614E+01-8.0035774E+01 3.6261414E+01
+ -96 43 27 -103 79 44
+ 104 83 41 -90 74 23
+ -54 50 4 -45 42 8
+ 5-8.0047302E+01 3.5899727E+01-7.9532631E+01 3.6257259E+01
+ 115 49 28 -116 92 51
+ 111 89 44 96 79 26
+ -53 43 13
+ 6-7.9542778E+01 3.5843235E+01-7.9237549E+01 3.6249851E+01
+ -117 46 30 -125 93 52
+ -126 99 51 -115 92 27
+ -52 49 13 -48 44 15
+ 7-7.7327950E+01 3.5811520E+01-7.6680542E+01 3.6246719E+01
+ -93 47 22 -108 77 1
+ -119 87 47 -133 96 39
+ 82 68 17 -68 59 9
+ -58 45 10
+ 5-7.9264854E+01 3.5860783E+01-7.8951065E+01 3.6243732E+01
+ 51 46 15 -57 48 16
+ 122 52 31 123 97 52
+ 117 93 28
+ 5-7.9016495E+01 3.5863003E+01-7.8699341E+01 3.6239021E+01
+ 85 54 14 -120 70 38
+ 121 94 52 -122 97 30
+ -62 52 16
+ 2-7.5787750E+01 3.5773632E+01-7.5534729E+01 3.6231594E+01
+ -139 55 1 -64 56 6
+ 5-7.8257187E+01 3.5728344E+01-7.7698235E+01 3.6202530E+01
+ 74 57 17 118 63 35
+ -145 95 53 -146 111 58
+ -131 103 25
+ 5-8.2416809E+01 3.5824280E+01-8.1979179E+01 3.6159000E+01
+ 113 67 24 127 90 49
+ -128 100 37 -83 69 1
+ -81 61 1
+ 5-7.7828773E+01 3.5677162E+01-7.7342773E+01 3.6154152E+01
+ 129 80 39 -157 101 55
+ -158 119 53 -118 95 33
+ -99 63 17
+ 6-8.1811691E+01 3.5757164E+01-8.1328575E+01 3.6122353E+01
+ 78 66 20 -100 64 19
+ 135 81 43 -140 105 56
+ 141 108 45 105 84 24
+ 5-8.2505531E+01 3.5698692E+01-8.2133347E+01 3.6084263E+01
+ 128 69 34 151 100 49
+ 148 114 57 -130 102 40
+ -102 82 1
+ 6-7.8995880E+01 3.5518925E+01-7.8255203E+01 3.6076088E+01
+ 95 70 14 132 78 25
+ -179 103 58 180 134 69
+ 164 123 52 120 94 31
+ 6-7.7409431E+01 3.5658325E+01-7.6761131E+01 3.6074780E+01
+ 98 80 17 133 68 29
+ -150 96 47 160 115 61
+ -144 110 55 -129 101 35
+ 6-8.2961853E+01 3.5678082E+01-8.2408882E+01 3.6065701E+01
+ 130 82 37 155 102 57
+ 156 118 59 136 106 1
+ 110 88 1 -107 76 1
+ 5-8.0708008E+01 3.5742672E+01-8.0365646E+01 3.6062351E+01
+ -104 74 26 142 83 44
+ 143 109 54 -124 98 42
+ -91 73 23
+ 9-8.1112083E+01 3.5506962E+01-8.0692909E+01 3.6057743E+01
+ 124 73 41 -188 98 54
+ -189 140 75 -190 141 72
+ -181 135 70 175 131 56
+ -137 107 43 -92 75 19
+ -89 72 23
+ 4-8.1343979E+01 3.5779045E+01-8.1003792E+01 3.6045567E+01
+ 101 81 19 137 75 42
+ 138 107 56 -135 105 36
+ 6-8.0488075E+01 3.5504196E+01-8.0043404E+01 3.6026592E+01
+ 103 83 26 -111 79 27
+ -192 89 51 193 142 74
+ -194 143 54 -142 109 41
+ 7-8.1987198E+01 3.5558136E+01-8.1364250E+01 3.6000000E+01
+ -141 84 36 -171 108 56
+ -172 129 70 -174 130 68
+ -165 124 66 -166 125 49
+ -106 85 24
+ 4-7.6404037E+01 3.5597824E+01-7.5995079E+01 3.5993340E+01
+ -159 91 48 162 120 62
+ 152 116 47 -114 86 1
+ 6-7.6841972E+01 3.5697304E+01-7.6353790E+01 3.5982136E+01
+ -152 86 46 153 116 62
+ 149 113 61 150 115 39
+ 119 96 29 -109 87 1
+ 3-7.6027817E+01 3.5570839E+01-7.5713158E+01 3.5974979E+01
+ 159 120 46 -170 91 1
+ 167 126 62
+ 6-8.2294930E+01 3.5517879E+01-8.1824364E+01 3.5959324E+01
+ 112 90 24 166 85 45
+ 182 125 66 177 132 57
+ -151 114 37 -127 100 34
+ 1-7.5727524E+01 3.5802872E+01-7.5613625E+01 3.5939606E+01
+ -134 104 1
+ 6-8.0066971E+01 3.5505749E+01-7.9542091E+01 3.5920502E+01
+ 116 89 27 126 92 28
+ 185 99 52 187 138 73
+ 191 139 74 192 142 44
+ 8-7.9556152E+01 3.5515007E+01-7.8906273E+01 3.5877254E+01
+ -164 94 38 -178 123 69
+ -183 133 65 -184 137 73
+ -185 138 51 125 99 28
+ -123 93 30 -121 97 31
+ 6-7.8192352E+01 3.5572544E+01-7.7661613E+01 3.5866989E+01
+ 145 111 33 158 95 35
+ 161 119 55 -168 121 64
+ 169 127 67 163 122 58
+ 5-8.0771759E+01 3.5501869E+01-8.0182907E+01 3.5863270E+01
+ 194 109 44 -195 143 76
+ 196 144 75 188 140 42
+ -143 98 41
+ 7-7.7700806E+01 3.5327827E+01-7.7085968E+01 3.5832745E+01
+ 144 101 39 203 110 61
+ 214 151 82 211 156 79
+ -200 148 64 -161 121 53
+ 157 119 35
+ 5-8.1534546E+01 3.5547676E+01-8.0924179E+01 3.5828930E+01
+ -175 107 42 -176 131 70
+ 171 129 45 140 108 36
+ -138 105 43
+ 6-8.2888237E+01 3.5416534E+01-8.2169182E+01 3.5823967E+01
+ -177 114 49 -199 132 66
+ 204 145 77 201 149 59
+ -155 118 40 -148 102 37
+ 6-7.8708893E+01 3.5256210E+01-7.8064888E+01 3.5817451E+01
+ 146 103 33 -163 111 53
+ -222 122 67 -225 163 86
+ -216 159 69 179 134 38
+ 7-8.3257683E+01 3.5291763E+01-8.2745361E+01 3.5790955E+01
+ 147 112 1 -156 106 40
+ -201 118 57 -220 149 80
+ 221 162 71 -186 136 63
+ -154 117 1
+ 2-7.5753769E+01 3.5187092E+01-7.5461288E+01 3.5774628E+01
+ 241 178 93 -240 171 1
+ 7-7.7194321E+01 3.5215881E+01-7.6468071E+01 3.5739246E+01
+ -208 113 62 -212 154 1
+ -231 157 84 226 165 82
+ -203 151 55 -160 110 39
+ -149 115 47
+ 5-7.6638641E+01 3.5325268E+01-7.5867485E+01 3.5705070E+01
+ -162 116 46 -167 120 48
+ -215 126 1 208 154 61
+ -153 113 47
+ 6-8.3952972E+01 3.5279453E+01-8.3156403E+01 3.5695713E+01
+ 186 117 59 213 136 71
+ -223 158 85 224 164 78
+ -197 147 1 -173 128 1
+ 4-7.7827904E+01 3.5347832E+01-7.7474861E+01 3.5652100E+01
+ 168 127 53 200 121 55
+ 210 148 79 -209 155 67
+ 3-7.9360245E+01 3.5306820E+01-7.8970894E+01 3.5628010E+01
+ 183 137 52 -217 133 69
+ -218 160 73
+ 8-8.2280670E+01 3.5180370E+01-8.1692513E+01 3.5612190E+01
+ 165 125 45 246 124 68
+ -247 181 1 -245 180 1
+ -238 177 83 207 153 77
+ 199 145 57 -182 132 49
+ 6-7.8304947E+01 3.5146156E+01-7.7800484E+01 3.5597610E+01
+ 209 127 64 248 155 79
+ 258 182 94 -237 176 86
+ 222 163 58 -169 122 53
+ 6-8.1768242E+01 3.5163322E+01-8.1321465E+01 3.5584091E+01
+ 174 124 45 -202 130 70
+ -252 150 81 -253 186 1
+ -250 184 1 -246 181 66
+ 7-7.9223328E+01 3.5192020E+01-7.8530487E+01 3.5583328E+01
+ 178 133 52 -180 123 38
+ 216 134 58 228 159 86
+ -234 167 88 -235 174 73
+ 217 160 65
+ 6-8.1537811E+01 3.5400696E+01-8.0941673E+01 3.5568680E+01
+ 172 130 45 176 129 56
+ 181 131 42 -205 135 72
+ -206 152 81 202 150 68
+ 5-8.3363876E+01 3.5000683E+01-8.2919968E+01 3.5524368E+01
+ -221 136 59 -271 162 80
+ -277 195 1 278 199 85
+ -213 158 63
+ 7-8.1057846E+01 3.5001560E+01-8.0550491E+01 3.5518200E+01
+ 190 135 42 232 141 75
+ -275 169 92 -276 198 1
+ -267 191 1 257 188 81
+ 205 152 70
+ 8-7.9774185E+01 3.5042873E+01-7.9096382E+01 3.5517841E+01
+ 184 138 52 218 137 65
+ 235 160 69 249 174 88
+ -268 183 90 -269 194 95
+ 251 185 74 -187 139 51
+ 5-8.0182907E+01 3.5137196E+01-7.9614532E+01 3.5511337E+01
+ -251 139 73 -263 185 95
+ 261 190 76 -193 143 44
+ -191 142 51
+ 5-8.0786736E+01 3.5185280E+01-8.0295616E+01 3.5506985E+01
+ 189 141 42 -196 140 54
+ -242 144 76 -243 179 92
+ -232 169 72
+ 5-8.0505638E+01 3.5142933E+01-8.0051445E+01 3.5504196E+01
+ 195 144 54 -261 143 74
+ 262 190 91 -254 172 92
+ 242 179 75
+ 5-8.2745361E+01 3.5145370E+01-8.2261627E+01 3.5500000E+01
+ -207 145 66 -236 153 83
+ -259 175 1 -260 189 80
+ -204 149 57
+ 5-8.4038414E+01 3.5216843E+01-8.3582420E+01 3.5466473E+01
+ -224 147 63 -227 164 85
+ 230 166 87 -219 161 1
+ -198 146 1
+ 6-7.7834549E+01 3.5007549E+01-7.7391281E+01 3.5426525E+01
+ -211 148 55 229 156 82
+ 273 168 89 274 197 94
+ -248 182 67 -210 155 64
+ 6-8.3056908E+01 3.5027431E+01-8.2575066E+01 3.5422817E+01
+ 220 162 59 260 149 77
+ -264 189 1 -266 192 1
+ -270 193 1 271 195 71
+ 4-8.1456696E+01 3.5148281E+01-8.0923149E+01 3.5419483E+01
+ 206 150 70 -257 152 72
+ -256 188 1 252 186 68
+ 6-7.7474113E+01 3.4831097E+01-7.6625000E+01 3.5418793E+01
+ -226 151 61 -291 165 84
+ -294 206 97 -298 211 89
+ -229 168 79 -214 156 55
+ 4-8.2359596E+01 3.5184677E+01-8.1961426E+01 3.5409004E+01
+ 236 175 77 238 153 66
+ -239 177 1 -244 173 1
+ 4-7.6987762E+01 3.4950275E+01-7.6466721E+01 3.5334160E+01
+ 231 165 61 -272 157 1
+ -288 196 97 291 206 82
+ 6-8.3738213E+01 3.4993198E+01-8.3108551E+01 3.5330910E+01
+ 223 164 63 -278 158 71
+ 279 199 1 -280 200 96
+ 255 187 87 227 166 78
+ 7-7.8672653E+01 3.4553711E+01-7.8113472E+01 3.5315102E+01
+ 225 159 58 237 163 67
+ 310 176 94 -316 218 102
+ 317 223 101 292 209 88
+ -228 167 69
+ 7-8.4321953E+01 3.4987251E+01-8.3690536E+01 3.5292099E+01
+ -255 166 85 285 187 96
+ -286 205 1 -283 203 1
+ -282 202 1 233 170 1
+ -230 161 78
+ 6-7.9113251E+01 3.4834126E+01-7.8495041E+01 3.5266777E+01
+ 234 174 69 -292 167 86
+ -295 209 101 -296 212 100
+ -290 208 90 -249 183 73
+ 5-7.7730774E+01 3.4780212E+01-7.7049896E+01 3.5242477E+01
+ 298 168 82 306 211 97
+ 307 217 99 289 207 94
+ -273 197 79
+ 4-7.9459206E+01 3.4833218E+01-7.9034958E+01 3.5213722E+01
+ 268 194 73 290 183 88
+ -297 208 100 -293 210 98
+ 4-8.0320625E+01 3.4806400E+01-7.9848770E+01 3.5210838E+01
+ 302 190 95 -303 215 1
+ -300 214 92 -262 172 76
+ 6-8.0840485E+01 3.4813854E+01-8.0277428E+01 3.5208263E+01
+ 243 169 75 254 179 76
+ 300 172 91 -301 214 1
+ -299 213 1 275 198 72
+ 2-7.6014427E+01 3.5064907E+01-7.5750946E+01 3.5196533E+01
+ -265 178 1 -241 171 60
+ 6-7.8200745E+01 3.4709194E+01-7.7651352E+01 3.5193733E+01
+ -274 182 79 -289 197 89
+ -308 207 99 -309 219 102
+ -310 218 86 -258 176 67
+ 5-8.0075607E+01 3.4804733E+01-7.9459206E+01 3.5183640E+01
+ 263 190 74 269 185 73
+ 304 194 98 -305 216 1
+ -302 215 91
+ 5-8.4005501E+01 3.4986500E+01-8.3483398E+01 3.5160774E+01
+ 280 187 85 -281 200 1
+ -287 201 1 -284 204 1
+ -285 205 87
+ 5-7.7167938E+01 3.4579765E+01-7.6035469E+01 3.5076370E+01
+ 288 206 84 -315 196 1
+ -311 220 99 -306 217 89
+ 294 211 82
+ 4-7.9688416E+01 3.4630272E+01-7.9331009E+01 3.5042873E+01
+ 293 194 90 312 210 100
+ -313 221 1 -304 216 95
+ 5-7.7686096E+01 3.4439243E+01-7.7096939E+01 3.4984245E+01
+ 311 217 97 -319 220 1
+ -320 225 102 308 219 94
+ -307 207 89
+ 7-7.9461983E+01 3.4299076E+01-7.8805481E+01 3.4953419E+01
+ 296 208 88 318 212 101
+ 325 224 103 -326 229 1
+ -314 222 1 -312 221 98
+ 297 210 90
+ 5-7.8901352E+01 3.4366920E+01-7.8176773E+01 3.4856094E+01
+ 295 212 88 -317 209 86
+ -321 223 102 322 226 103
+ -318 224 100
+ 8-7.8272507E+01 3.4292061E+01-7.7517929E+01 3.4732109E+01
+ 309 218 94 320 219 99
+ -327 225 1 328 230 104
+ 324 228 105 323 227 103
+ 321 226 101 316 223 86
+ 5-7.9071419E+01 3.3944073E+01-7.8162560E+01 3.4482864E+01
+ -323 226 102 -329 227 105
+ -330 231 1 -325 229 100
+ -322 224 101
+ 3-7.8030205E+01 3.3927631E+01-7.7716362E+01 3.4389191E+01
+ -331 230 1 332 232 105
+ -328 228 102
+ 5-7.8650589E+01 3.3830425E+01-7.7931229E+01 3.4371643E+01
+ -332 228 104 -334 232 1
+ -333 233 1 329 231 103
+ -324 227 102
+ -1 0 0 0 0 0 0
+TOL 2
+ 1 1 1.9999999E-05
+ 2 2 0.0000000E+00
+ 3 2 0.0000000E+00
+ 4 2 1.0000000E-03
+ 5 2 0.0000000E+00
+ 6 2 8.8606644E-02
+ 7 2 8.8606644E-03
+ 8 2 8.8606644E-03
+ 9 2 8.8606644E-03
+ 10 2 8.8606644E-03
+ -1 0 0 0 0 0 0
+SIN 2
+EOX
+LOG 2
+199706161751 0 16 138abishton PROJECT COVER CO_99 CO_99L
+~
+199706161751 0 0 0abishton TOLERANCE CO_99L FUZZY .00002
+~
+199706161751 0 0 0abishton TOLERANCE CO_99L DANGLE .001
+~
+199706161752 1 69 276abishton build CO_99L poly
+~
+199706161752 0 0 0abishton labelerrors CO_99L
+~
+199706161752 0 0 0abishton nodeerrors CO_99L dangles
+~
+199706161752 0 0 5abishton rename CO_99L CO_99
+~
+199903081411 0 6 6gcoleman import cover co_99.e00 co_99
+~
+199903081412 0 3 5gcoleman PROJECT COVER co_99 co_99g
+~
+199903081412 0 0 0gcoleman rename co_99g co_99
+~
+199903081412 0 14 22gcoleman build co_99
+~
+199903081412 0 0 0gcoleman rename co_99 co99_d90
+~
+19990406 942 0 6 4gcoleman import cover co99_d90 co99_d90
+~
+199904061328 0 1 25gcoleman reselect co99_d90 co37_d90 polys
+~
+EOL
+PRJ 2
+Projection GEOGRAPHIC
+~
+Zunits NO
+~
+Units DD
+~
+Spheroid CLARKE1866
+~
+Xshift 0.0000000000
+~
+Yshift 0.0000000000
+~
+Parameters
+~
+EOP
+IFO 2
+CO37_D90.AAT XX 7 7 28 334
+FNODE# 4-1 14-1 5-1 50-1 -1 -1-1 1-
+TNODE# 4-1 54-1 5-1 50-1 -1 -1-1 2-
+LPOLY# 4-1 94-1 5-1 50-1 -1 -1-1 3-
+RPOLY# 4-1 134-1 5-1 50-1 -1 -1-1 4-
+LENGTH 4-1 174-1 12 3 60-1 -1 -1-1 5-
+CO37_D90# 4-1 214-1 5-1 50-1 -1 -1-1 6-
+CO37_D90-ID 4-1 254-1 5-1 50-1 -1 -1-1 7-
+ 2 1 2 1 3.2479227E-01 1 30142
+ 3 2 3 1 4.5180720E-01 2 30157
+ 3 4 1 4 6.3827462E-02 3 31782
+ 4 5 1 4 2.2593810E-01 4 31869
+ 9 5 4 1 1.7219386E-01 5 35521
+ 10 8 7 1 1.7828377E-01 6 34093
+ 7 11 6 1 2.5527215E-01 7 29372
+ 11 10 6 1 1.9084930E-01 8 37244
+ 8 12 7 1 5.0180126E-02 9 34093
+ 12 6 5 1 3.7420315E-01 10 34136
+ 15 13 1 9 1.3237870E-01 11 35756
+ 15 14 9 1 4.7022286E-01 12 35061
+ 16 14 1 9 1.3265443E-01 13 31329
+ 17 16 1 11 1.4642422E-01 14 31329
+ 18 17 1 11 2.7770254E-01 15 36603
+ 6 19 5 1 8.2792994E-03 16 34136
+ 13 19 1 10 2.4866450E-01 17 35756
+ 21 20 1 8 2.6191713E-02 18 35552
+ 21 9 8 1 3.8678482E-01 19 35521
+ 22 18 1 12 1.3306335E-01 20 36603
+ 24 20 13 1 3.1240892E-01 21 34505
+ 23 26 14 1 6.2149499E-02 22 35144
+ 26 25 16 1 3.4162140E-01 23 35144
+ 25 27 15 1 8.0696166E-02 24 34471
+ 27 28 15 1 1.2404662E-01 25 34471
+ 23 22 1 14 2.7720708E-01 26 36603
+ 28 29 15 1 1.2747309E-01 27 34471
+ 29 30 15 1 4.0481653E-02 28 34471
+ 30 24 13 1 2.0420428E-01 29 34505
+ 12 31 7 5 6.4055182E-02 30 34090
+ 16 32 9 11 3.7862841E-02 31 42730
+ 3 33 4 3 1.9984943E-01 32 30149
+ 1 34 2 1 2.7829757E-01 33 30142
+ 35 31 5 18 1.4003085E-01 34 34135
+ 33 36 19 3 3.8725334E-01 35 30200
+ 2 36 3 2 2.9975727E-01 36 30134
+ 35 37 21 5 1.1040402E-01 37 35478
+ 37 38 22 5 1.8662021E-01 38 31064
+ 19 38 5 10 4.8106065E-01 39 41266
+ 34 39 20 1 3.3020034E-01 40 30705
+ 40 18 12 11 2.9177651E-01 41 49470
+ 39 41 24 1 2.6648061E-02 42 30660
+ 42 9 4 8 2.8934830E-01 43 49077
+ 20 43 13 8 2.8530619E-01 44 48407
+ 43 42 26 8 4.1641781E-01 45 39734
+ 44 30 13 15 2.9164448E-01 46 34504
+ 13 45 10 9 5.1068455E-01 47 41278
+ 46 44 28 15 2.7506196E-01 48 29315
+ 38 47 22 10 5.8438517E-02 49 31062
+ 25 48 16 15 3.0003411E-01 50 34464
+ 46 48 15 30 1.0324056E-01 51 29348
+ 44 49 28 13 8.5624689E-03 52 29217
+ 49 43 27 13 5.0340140E-01 53 29268
+ 42 50 26 4 2.0331958E-02 54 39791
+ 51 36 2 19 3.5822189E-01 55 30077
+ 51 34 20 2 3.0259177E-01 56 30447
+ 52 48 30 16 2.0295586E-01 57 38701
+ 47 45 29 10 5.0342000E-01 58 31009
+ 50 53 23 4 5.4990190E-01 59 49135
+ 33 53 4 19 2.2635865E-01 60 30170
+ 26 54 14 16 3.0593604E-01 61 41349
+ 54 52 31 16 1.4882337E-01 62 38679
+ 55 7 6 1 3.3321226E-01 63 154
+ 55 56 32 6 1.4294658E-02 64 37227
+ 32 57 17 11 3.3997834E-01 65 42738
+ 57 40 25 11 3.6331365E-01 66 40535
+ 58 22 14 12 4.2667836E-01 67 41366
+ 45 59 29 9 1.6109870E-01 68 31140
+ 32 59 9 17 9.2323500E-01 69 42726
+ 58 40 12 25 2.6771668E-01 70 40558
+ 31 60 7 18 7.5530106E-01 71 34091
+ 10 62 6 7 7.1833295E-01 72 34083
+ 60 62 7 1 1.4875008E-01 73 160
+ 57 63 17 33 4.7745344E-01 74 39283
+ 64 51 20 19 1.6597551E-01 75 30440
+ 65 60 18 1 1.6263527E-01 76 160
+ 35 65 18 21 4.1801026E-01 77 34140
+ 66 64 20 36 2.6709870E-01 78 33860
+ 66 39 24 20 2.7421165E-01 79 30657
+ 41 67 24 1 2.3651269E-01 80 30635
+ 67 61 34 1 1.8611769E-01 81 30635
+ 68 59 17 29 2.4417037E-01 82 31112
+ 61 69 34 1 2.3818263E-01 83 30694
+ 62 56 6 1 1.0707690E+00 84 160
+ 54 70 14 31 2.3218536E-01 85 38661
+ 71 65 21 1 2.3236835E-01 86 160
+ 71 37 22 21 4.4856450E-01 87 31066
+ 53 72 23 19 1.8086883E-01 88 49200
+ 73 72 42 23 1.8953270E-01 89 38049
+ 50 74 26 23 2.7557778E-01 90 39792
+ 74 73 41 23 1.9633454E-01 91 37984
+ 72 75 42 19 1.4838044E-01 92 43746
+ 77 47 29 22 2.3773040E-01 93 31004
+ 78 58 14 25 1.6493052E-01 94 40366
+ 70 78 14 38 2.1277025E-01 95 38749
+ 79 43 26 27 2.4707751E-01 96 39733
+ 77 71 22 1 3.1112182E-01 97 160
+ 80 68 17 39 1.0263621E-01 98 31113
+ 80 63 35 17 4.9925673E-01 99 39278
+ 81 64 36 19 3.0638212E-01 100 33873
+ 81 75 19 43 3.3453387E-01 101 30048
+ 69 82 37 1 1.3494626E-01 102 30694
+ 83 79 26 44 3.9282051E-01 103 37549
+ 83 74 41 26 1.7637494E-01 104 37982
+ 84 66 24 36 2.2182721E-01 105 30585
+ 84 85 45 24 1.7055841E-01 106 30561
+ 82 76 40 1 2.2086826E-01 107 33043
+ 87 77 29 1 9.9452816E-02 108 160
+ 86 87 47 1 3.5584003E-01 109 160
+ 88 76 1 40 4.2208445E-01 110 33031
+ 89 79 44 27 8.9882568E-02 111 37567
+ 90 85 24 49 7.7832088E-02 112 30556
+ 67 90 24 34 2.5692755E-01 113 30628
+ 91 86 46 1 4.2605895E-01 114 160
+ 49 92 28 27 3.4173343E-01 115 29216
+ 89 92 27 51 5.0563782E-01 116 29408
+ 93 46 28 30 3.7325692E-01 117 29319
+ 63 95 35 33 3.1717059E-01 118 39279
+ 96 87 29 47 1.1296346E-01 119 31030
+ 94 70 31 38 4.7781956E-01 120 38738
+ 94 97 52 31 1.1032562E-01 121 34969
+ 52 97 31 30 3.8166878E-01 122 38675
+ 97 93 52 30 2.4299976E-01 123 34970
+ 73 98 41 42 1.9892283E-01 124 38045
+ 99 93 28 52 3.4626493E-01 125 29420
+ 92 99 28 51 5.6496024E-02 126 29381
+ 90 100 49 34 2.2551124E-01 127 30569
+ 69 100 34 37 7.0267832E-01 128 45984
+ 80 101 39 35 2.1136519E-01 129 31159
+ 82 102 37 40 2.4937904E-01 130 44977
+ 57 103 33 25 4.5837530E-01 131 40526
+ 78 103 25 38 3.9096728E-01 132 40377
+ 68 96 29 39 1.0808014E+00 133 31128
+ 104 104 50 1 4.1204193E-01 134 162
+ 81 105 43 36 2.1772595E-01 135 29846
+ 106 88 1 40 2.4629535E-01 136 31298
+ 75 107 42 43 3.0892897E-01 137 30026
+ 107 105 56 43 2.7196336E-01 138 29981
+ 56 55 32 1 1.0786979E+00 139 160
+ 108 105 36 56 5.1981699E-02 140 29879
+ 108 84 45 36 5.6877047E-01 141 30564
+ 83 109 44 41 4.7350600E-01 142 37392
+ 109 98 54 41 3.7179840E-01 143 37938
+ 101 110 39 55 2.3055837E-01 144 39314
+ 111 95 33 53 4.0707174E-01 145 39500
+ 103 111 33 58 1.4838824E-01 146 40455
+ 112 106 1 59 3.3989537E-01 147 31296
+ 114 102 57 37 2.2338277E-01 148 32411
+ 113 115 61 47 2.0172560E-01 149 30899
+ 115 96 39 47 2.3483819E-01 150 31103
+ 100 114 49 37 2.2526555E-01 151 30570
+ 116 86 47 46 2.8241289E-01 152 35487
+ 116 113 62 47 2.4320129E-01 153 30911
+ 112 117 59 1 2.5461247E-02 154 31295
+ 102 118 57 40 5.9513205E-01 155 32410
+ 118 106 59 40 1.8753302E-01 156 31923
+ 119 101 35 55 3.7075731E-01 157 39254
+ 95 119 35 53 2.6952380E-01 158 39406
+ 120 91 46 48 2.5049415E-01 159 34131
+ 115 110 61 39 3.6064357E-01 160 30934
+ 119 121 55 53 4.6520539E-02 161 39526
+ 120 116 62 46 6.4794898E-01 162 34363
+ 122 111 58 53 2.2039929E-01 163 44201
+ 123 94 52 38 3.5874471E-01 164 34973
+ 125 124 45 66 1.9405012E-01 165 33061
+ 85 125 45 49 5.1986390E-01 166 30562
+ 126 120 62 48 2.3353359E-01 167 34361
+ 127 121 53 64 1.4661290E-01 168 39536
+ 127 122 67 53 2.6254943E-01 169 41564
+ 126 91 48 1 7.8718823E-01 170 160
+ 129 108 45 56 2.6320186E-01 171 32895
+ 130 129 45 70 5.5919299E-03 172 32981
+ 117 128 63 1 4.9482203E-01 173 31295
+ 124 130 45 68 1.8265221E-01 174 32980
+ 131 107 56 42 3.7964115E-01 175 29982
+ 129 131 56 70 5.7469428E-01 176 34756
+ 132 114 57 49 2.9833168E-01 177 32220
+ 133 123 52 69 8.2799546E-02 178 35138
+ 134 103 38 58 5.4809654E-01 179 40491
+ 134 123 69 38 2.1609622E-01 180 35145
+ 131 135 42 70 5.8185276E-02 181 34738
+ 125 132 66 49 3.9231542E-01 182 33065
+ 137 133 52 65 5.8270764E-01 183 35150
+ 138 137 52 73 2.0581481E-01 184 35222
+ 99 138 52 51 3.2850036E-01 185 29384
+ 117 136 59 63 3.1784564E-01 186 43077
+ 138 139 73 51 2.1806371E-01 187 35255
+ 140 98 42 54 3.6059934E-01 188 38031
+ 141 140 42 75 4.6966556E-02 189 33161
+ 135 141 42 72 1.7199078E-01 190 33173
+ 139 142 74 51 2.9283896E-01 191 46083
+ 142 89 44 51 4.1521907E-01 192 37586
+ 142 143 74 44 1.1594667E-01 193 37672
+ 109 143 44 54 4.3741760E-01 194 37310
+ 144 143 54 76 1.1271578E-01 195 33424
+ 144 140 75 54 4.4174582E-01 196 33416
+ 128 147 63 1 3.4180921E-01 197 29853
+ 147 146 78 1 9.4312560E-03 198 29853
+ 145 132 57 66 1.5244924E-01 199 32121
+ 121 148 55 64 4.0299305E-01 200 39530
+ 149 118 59 57 4.1890761E-01 201 31921
+ 150 130 68 70 1.7730193E-01 202 32998
+ 110 151 61 55 5.9861410E-01 203 30936
+ 145 149 77 57 6.5543258E-01 204 32089
+ 152 135 70 72 1.4187497E-01 205 43865
+ 150 152 70 81 5.0145835E-01 206 34763
+ 153 145 77 66 8.7977380E-02 207 32091
+ 154 113 61 62 5.9676385E-01 208 30896
+ 127 155 64 67 2.1398783E-01 209 41546
+ 148 155 79 64 4.0552208E-01 210 36285
+ 156 148 79 55 1.7096253E-01 211 36286
+ 157 154 61 1 1.4425176E-01 212 160
+ 136 158 71 63 3.6488044E-01 213 43244
+ 151 156 82 55 2.9684851E-01 214 30756
+ 154 126 62 1 8.2409120E-01 215 160
+ 134 159 58 69 3.1460273E-01 216 42956
+ 160 133 65 69 3.0259705E-01 217 35161
+ 137 160 65 73 3.4483153E-01 218 35229
+ 146 161 78 1 2.6299456E-01 219 29841
+ 162 149 59 80 2.5446454E-01 220 31848
+ 162 136 71 59 4.3066379E-01 221 43199
+ 163 122 58 67 4.7104630E-01 222 44227
+ 164 158 63 85 3.7064621E-01 223 44026
+ 164 147 78 63 6.5812749E-01 224 41289
+ 159 163 58 86 2.6323366E-01 225 44291
+ 165 151 82 61 3.3878505E-01 226 30754
+ 166 164 78 85 3.8343754E-02 227 35430
+ 159 167 86 69 1.2095597E-01 228 36598
+ 156 168 82 79 2.0643760E-01 229 36143
+ 166 161 87 78 4.1801167E-01 230 35403
+ 165 157 61 84 3.8535926E-01 231 30857
+ 141 169 75 72 4.2839625E-01 232 33170
+ 170 161 1 87 3.4407941E-01 233 34753
+ 174 167 69 88 5.3386903E-01 234 36460
+ 160 174 69 73 2.1497202E-01 235 36537
+ 175 153 77 83 2.6450470E-01 236 32093
+ 163 176 67 86 1.8613102E-01 237 38361
+ 153 177 66 83 4.7430512E-01 238 32254
+ 173 177 83 1 2.4704266E-01 239 47680
+ 178 171 60 1 1.5953286E+00 240 161
+ 178 171 93 60 9.8543493E-03 241 34361
+ 179 144 75 76 3.8482091E-01 242 33418
+ 169 179 75 92 5.0568771E-02 243 33281
+ 175 173 83 1 1.4518194E-01 244 47680
+ 177 180 66 1 9.4939969E-02 245 35898
+ 124 181 68 66 4.1195160E-01 246 33057
+ 180 181 66 1 1.0643061E-01 247 35898
+ 155 182 79 67 1.9887273E-01 248 41512
+ 174 183 88 73 1.9202719E-02 249 36539
+ 181 184 68 1 4.0165538E-01 250 35617
+ 185 139 74 73 4.1406363E-01 251 46080
+ 186 150 68 81 3.3018506E-01 252 35559
+ 184 186 68 1 3.8723003E-02 253 35617
+ 179 172 76 92 2.8294942E-01 254 30348
+ 187 166 87 85 1.4751722E-01 255 35404
+ 186 188 81 1 2.9518464E-01 256 40943
+ 188 152 81 72 4.2743957E-01 257 40730
+ 182 176 94 67 3.7650874E-01 258 38333
+ 189 175 77 1 3.4859836E-01 259 43464
+ 149 189 77 80 3.6516750E-01 260 31893
+ 190 143 76 74 4.8968112E-01 261 33433
+ 190 172 91 76 3.4240147E-01 262 30315
+ 190 185 74 95 4.8753041E-01 263 46013
+ 192 189 80 1 2.8303590E-01 264 43484
+ 171 178 93 1 6.0890132E-01 265 161
+ 193 192 80 1 1.6133139E-01 266 49353
+ 188 191 72 1 3.0944133E-01 267 40933
+ 194 183 73 90 5.0551105E-01 268 36605
+ 185 194 73 95 2.4531291E-01 269 46019
+ 195 193 80 1 1.1479705E-01 270 49353
+ 195 162 71 80 4.0968052E-01 271 43121
+ 196 157 84 1 5.1886410E-01 272 160
+ 168 197 89 79 4.0749407E-01 273 36276
+ 197 182 94 79 2.2224833E-01 274 38097
+ 198 169 72 92 3.6106724E-01 275 33255
+ 191 198 72 1 1.0013133E-01 276 40933
+ 199 195 71 1 1.0334467E-01 277 43997
+ 199 158 85 71 5.6681049E-01 278 44099
+ 199 200 1 85 3.7480772E-01 279 35497
+ 187 200 85 96 4.6521059E-01 280 35448
+ 201 200 96 1 6.6113509E-02 281 35491
+ 170 202 87 1 2.2026518E-01 282 35020
+ 202 203 87 1 1.9231628E-01 283 35452
+ 205 204 96 1 6.8756267E-02 284 35491
+ 187 205 96 87 3.7992021E-01 285 35394
+ 203 205 87 1 1.2413800E-01 286 35452
+ 204 201 96 1 3.9294270E-01 287 35491
+ 206 196 84 97 7.1139596E-02 288 30872
+ 207 197 94 89 6.2861308E-02 289 38066
+ 183 208 88 90 2.6140884E-01 290 36522
+ 206 165 82 84 6.1074436E-01 291 30775
+ 209 167 88 86 6.0800624E-01 292 36476
+ 194 210 90 98 2.7721283E-01 293 43595
+ 211 206 82 97 5.7659590E-01 294 34163
+ 212 209 88 101 4.1123357E-01 295 31381
+ 208 212 88 100 1.9524886E-01 296 36653
+ 210 208 90 100 3.5421216E-01 297 36740
+ 168 211 82 89 7.4564755E-01 298 36138
+ 198 213 92 1 4.4087741E-01 299 45421
+ 172 214 91 92 3.8457114E-01 300 30317
+ 213 214 92 1 2.4127412E-01 301 45421
+ 190 215 95 91 5.9387344E-01 302 30206
+ 214 215 91 1 3.9286247E-01 303 30255
+ 194 216 98 95 4.5390376E-01 304 43659
+ 215 216 95 1 2.4011809E-01 305 47938
+ 211 217 97 89 1.6788469E-01 306 34267
+ 217 207 99 89 7.2062808E-01 307 38149
+ 219 207 94 99 2.6327965E-01 308 38088
+ 218 219 94 102 4.7227952E-01 309 38144
+ 176 218 94 86 5.6488746E-01 310 38284
+ 217 220 97 99 2.3407945E-01 311 34268
+ 210 221 100 98 2.7474129E-01 312 43675
+ 216 221 98 1 2.8785434E-01 313 48003
+ 221 222 100 1 1.5020199E-02 314 48173
+ 220 196 97 1 2.2331579E+00 315 160
+ 223 218 86 102 2.2461502E-01 316 31494
+ 223 209 101 86 5.5259830E-01 317 31394
+ 212 224 101 100 5.0309736E-01 318 31404
+ 225 220 99 1 4.5363879E-01 319 160
+ 219 225 99 102 3.4194124E-01 320 38194
+ 226 223 101 102 2.8677180E-01 321 31410
+ 226 224 103 101 6.7833936E-01 322 31300
+ 227 226 103 102 1.3376004E-01 323 31370
+ 228 227 105 102 1.8943951E-01 324 31631
+ 224 229 103 100 4.0038490E-01 325 31276
+ 222 229 100 1 4.9707049E-01 326 48173
+ 230 225 102 1 2.4763992E-01 327 160
+ 230 228 104 102 5.0426883E-01 328 46528
+ 231 227 103 105 9.3478608E-01 329 31373
+ 229 231 103 1 5.5056798E-01 330 36054
+ 232 230 104 1 4.3137681E-01 331 160
+ 232 228 105 104 5.4064643E-01 332 31637
+ 231 233 105 1 1.4242120E-01 333 31580
+ 233 232 105 1 7.2386247E-01 334 160
+CO37_D90.BND XX 4 4 16 1
+XMIN 4-1 14-1 12 3 60-1 -1 -1-1 1-
+YMIN 4-1 54-1 12 3 60-1 -1 -1-1 2-
+XMAX 4-1 94-1 12 3 60-1 -1 -1-1 3-
+YMAX 4-1 134-1 12 3 60-1 -1 -1-1 4-
+-8.4321953E+01 3.3830425E+01-7.5461288E+01 3.6588001E+01
+CO37_D90.PAT XX 7 9 82 105
+AREA 4-1 14-1 12 3 60-1 -1 -1-1 1-
+PERIMETER 4-1 54-1 12 3 60-1 -1 -1-1 2-
+CO37_D90# 4-1 94-1 5-1 50-1 -1 -1-1 3-
+CO37_D90-ID 4-1 134-1 5-1 50-1 -1 -1-1 4-
+ST 2-1 174-1 2-1 20-1 -1 -1-1 5-
+CO 3-1 194-1 3-1 20-1 -1 -1-1 6-
+NAME 60-1 224-1 60-1 20-1 -1 -1-1 7-
+FULLCODE 5-1 170-1 5-1 20-1 -1 -1-1 -1-
+FULLSTCO 5-1 170-1 5-1 20-1 -1 -1-1 -1-
+-1.2960730E+01 3.0155142E+01 1 0
+
+ 1.1110494E-01 1.5636607E+00 2 199137009Ashe
+
+ 6.1226677E-02 1.3386673E+00 3 198337005Alleghany
+
+ 1.4001320E-01 1.7477497E+00 4 196537171Surry
+
+ 9.0124190E-02 1.3646533E+00 5 184737073Gates
+
+ 8.1319980E-02 2.5827303E+00 6 181837053Currituck
+
+ 7.0627876E-02 1.9149032E+00 7 183937029Camden
+
+ 1.1858533E-01 1.4040488E+00 8 195737169Stokes
+
+ 1.4326620E-01 2.3681371E+00 9 186637131Northampton
+
+ 9.3641378E-02 1.8022681E+00 10 186237091Hertford
+
+ 1.1547363E-01 1.4570581E+00 11 189237185Warren
+
+ 7.0172548E-02 1.1192349E+00 12 191037181Vance
+
+ 1.4893693E-01 1.6055278E+00 13 194437157Rockingham
+
+ 1.3932389E-01 1.6818571E+00 14 191237077Granville
+
+ 1.1152851E-01 1.3426787E+00 15 193537033Caswell
+
+ 1.0513196E-01 1.2993708E+00 16 192437145Person
+
+ 1.8982828E-01 2.5867300E+00 17 189837083Halifax
+
+ 6.5355547E-02 1.4759774E+00 18 185437139Pasquotank
+
+ 1.9714148E-01 2.1079745E+00 19 201437193Wilkes
+
+ 8.1314854E-02 1.3400780E+00 20 203737189Watauga
+
+ 7.0955627E-02 1.2093471E+00 21 187537143Perquimans
+
+ 5.0601017E-02 1.2424754E+00 22 188737041Chowan
+
+ 8.7497875E-02 1.3922157E+00 23 202937197Yadkin
+
+ 6.3979059E-02 1.2645177E+00 24 205337011Avery
+
+ 1.2808196E-01 1.6453034E+00 25 196137069Franklin
+
+ 1.0694399E-01 1.5286005E+00 26 202137067Forsyth
+
+ 1.7038327E-01 1.6877327E+00 27 201037081Guilford
+
+ 1.1268800E-01 1.4013758E+00 28 200237001Alamance
+
+ 1.8877168E-01 2.4396372E+00 29 191737015Bertie
+
+ 1.0380660E-01 1.3041219E+00 30 199337135Orange
+
+ 7.7229351E-02 1.3508227E+00 31 198837063Durham
+
+ 1.3888120E-02 1.0929927E+00 32 188537055Dare
+
+ 1.4038074E-01 1.8084593E+00 33 196937127Nash
+
+ 5.7525635E-02 1.6094174E+00 34 209437121Mitchell
+
+ 1.3120179E-01 1.6680737E+00 35 196737065Edgecombe
+
+ 1.2273393E-01 1.6337861E+00 36 208837027Caldwell
+
+ 8.0919810E-02 1.5356519E+00 37 210737199Yancey
+
+ 2.2117579E-01 2.2044945E+00 38 201937183Wake
+
+ 1.1954773E-01 2.2208428E+00 39 197437117Martin
+
+ 1.1672033E-01 1.9212922E+00 40 211637115Madison
+
+ 6.8944320E-02 1.4169368E+00 41 206037059Davie
+
+ 1.5328248E-01 1.8631481E+00 42 207437097Iredell
+
+ 6.8081953E-02 1.1331521E+00 43 208937003Alexander
+
+ 1.4675111E-01 1.9247924E+00 44 205937057Davidson
+
+ 1.3284123E-01 1.9046888E+00 45 211437023Burke
+
+ 1.1407834E-01 1.6069150E+00 46 195037177Tyrrell
+
+ 9.7718321E-02 1.4309814E+00 47 196037187Washington
+
+ 9.2372298E-02 1.2712160E+00 48 194337055Dare
+
+ 1.1515968E-01 1.7391199E+00 49 212037111McDowell
+
+ 5.8059008E-03 4.1204193E-01 50 194737055Dare
+
+ 2.0336214E-01 1.8167560E+00 51 207237151Randolph
+
+ 1.8302624E-01 2.2581573E+00 52 205637037Chatham
+
+ 9.6562661E-02 1.3526777E+00 53 203437195Wilson
+
+ 1.3493453E-01 1.7242769E+00 54 211037159Rowan
+
+ 1.6851254E-01 2.1172545E+00 55 202837147Pitt
+
+ 1.0676597E-01 1.5414823E+00 56 212937035Catawba
+
+ 1.6996633E-01 2.3436360E+00 57 215837021Buncombe
+
+ 2.0495085E-01 1.9657668E+00 58 204837101Johnston
+
+ 1.4281508E-01 1.9747711E+00 59 218337087Haywood
+
+ 1.2211216E-02 1.6051829E+00 60 197337055Dare
+
+ 2.4277961E-01 2.6261432E+00 61 203137013Beaufort
+
+ 1.9108446E-01 2.5455389E+00 62 201337095Hyde
+
+ 1.3906303E-01 2.5481310E+00 63 220137173Swain
+
+ 6.8512104E-02 1.1691158E+00 64 206337079Greene
+
+ 6.6485539E-02 1.2301362E+00 65 211537105Lee
+
+ 1.4526635E-01 1.9144194E+00 66 218837161Rutherford
+
+ 1.4300866E-01 1.7090961E+00 67 209137191Wayne
+
+ 1.2034211E-01 1.5424691E+00 68 218937045Cleveland
+
+ 1.5456891E-01 1.7858926E+00 69 211737085Harnett
+
+ 7.9107851E-02 1.4591067E+00 70 218437109Lincoln
+
+ 1.2690921E-01 1.8753799E+00 71 222637099Jackson
+
+ 1.4089525E-01 1.9403415E+00 72 218537119Mecklenburg
+
+ 1.8133470E-01 2.1677723E+00 73 213737125Moore
+
+ 1.2858292E-01 1.8000607E+00 74 215037123Montgomery
+
+ 9.3859352E-02 1.3524983E+00 75 217237025Cabarrus
+
+ 1.0373662E-01 1.6125687E+00 76 216837167Stanly
+
+ 9.6233539E-02 1.7216805E+00 77 221337089Henderson
+
+ 7.7455893E-02 1.3869088E+00 78 225737075Graham
+
+ 1.0318346E-01 1.6115373E+00 79 210437107Lenoir
+
+ 9.7642623E-02 1.5884769E+00 80 224437175Transylvania
+
+ 9.3145847E-02 1.5542676E+00 81 220337071Gaston
+
+ 1.9533850E-01 2.7750590E+00 82 210037049Craven
+
+ 6.1112307E-02 1.1310344E+00 83 222437149Polk
+
+ 1.0814156E-01 1.5861074E+00 84 209937137Pamlico
+
+ 1.3299669E-01 1.9633360E+00 85 227037113Macon
+
+ 2.4214832E-01 2.5204277E+00 86 215537163Sampson
+
+ 1.1940874E-01 1.8262479E+00 87 228237039Cherokee
+
+ 1.6858888E-01 2.0289693E+00 88 217537051Cumberland
+
+ 1.2139441E-01 2.1045158E+00 89 213837103Jones
+
+ 1.0042062E-01 1.3983449E+00 90 219537093Hoke
+
+ 1.3736744E-01 1.7137085E+00 91 221937007Anson
+
+ 1.6382313E-01 1.7613081E+00 92 222337179Union
+
+ 3.4505499E-03 6.1875564E-01 93 209837095Hyde
+
+ 2.0927513E-01 1.9620650E+00 94 216437061Duplin
+
+ 1.2267718E-01 2.0207386E+00 95 220937153Richmond
+
+ 5.6597192E-02 1.3729433E+00 96 229537043Clay
+
+ 1.9827215E-01 3.2828577E+00 97 213037031Carteret
+
+ 8.1879988E-02 1.2937123E+00 98 222837165Scotland
+
+ 2.0945127E-01 2.0135672E+00 99 219337133Onslow
+
+ 2.4209885E-01 2.2397752E+00 100 223637155Robeson
+
+ 2.2572935E-01 2.4320405E+00 101 224637017Bladen
+
+ 2.2428663E-01 2.4007158E+00 102 224937141Pender
+
+ 2.4197409E-01 2.6978383E+00 103 231337047Columbus
+
+ 5.6153055E-02 1.4762920E+00 104 229637129New Hanover
+
+ 2.2765237E-01 2.5311556E+00 105 231837019Brunswick
+
+CO37_D90.TIC XX 3 3 12 196
+IDTIC 4-1 14-1 5-1 50-1 -1 -1-1 1-
+XTIC 4-1 54-1 12 3 60-1 -1 -1-1 2-
+YTIC 4-1 94-1 12 3 60-1 -1 -1-1 3-
+ 1-7.1787483E+01 4.0950821E+01
+ 4-7.1787483E+01 4.2050495E+01
+ 2-7.3728203E+01 4.0950821E+01
+ 3-7.3728203E+01 4.2050495E+01
+ 6-6.6885658E+01 4.2917034E+01
+ 9-6.6885658E+01 4.7459648E+01
+ 7-7.1084816E+01 4.2917034E+01
+ 8-7.1084816E+01 4.7459648E+01
+ 11-6.9859398E+01 4.1186928E+01
+ 14-6.9859398E+01 4.2886700E+01
+ 12-7.3508575E+01 4.1186928E+01
+ 13-7.3508575E+01 4.2886700E+01
+ 16-7.0575600E+01 4.2696896E+01
+ 19-7.0575600E+01 4.5305428E+01
+ 17-7.2557709E+01 4.2696896E+01
+ 18-7.2557709E+01 4.5305428E+01
+ 21-7.1089081E+01 4.1095734E+01
+ 24-7.1089081E+01 4.2018700E+01
+ 22-7.1907745E+01 4.1095734E+01
+ 23-7.1907745E+01 4.2018700E+01
+ 26-7.1465034E+01 4.2726772E+01
+ 29-7.1465034E+01 4.5016617E+01
+ 27-7.3438179E+01 4.2726772E+01
+ 28-7.3438179E+01 4.5016617E+01
+ 31-7.4984543E+01 3.8450901E+01
+ 34-7.4984543E+01 3.9838898E+01
+ 32-7.5789101E+01 3.8450901E+01
+ 33-7.5789101E+01 3.9838898E+01
+ 36-7.6909706E+01 3.8791401E+01
+ 39-7.6909706E+01 3.8994999E+01
+ 37-7.7120201E+01 3.8791401E+01
+ 38-7.7120201E+01 3.8994999E+01
+ 41-7.4986664E+01 3.7886478E+01
+ 44-7.4986664E+01 3.9722958E+01
+ 42-7.9487877E+01 3.7886478E+01
+ 43-7.9487877E+01 3.9722958E+01
+ 46-7.3885483E+01 3.8788544E+01
+ 49-7.3885483E+01 4.1357330E+01
+ 47-7.5563934E+01 3.8788544E+01
+ 48-7.5563934E+01 4.1357330E+01
+ 51-7.1777985E+01 4.0477276E+01
+ 54-7.1777985E+01 4.5015804E+01
+ 52-7.9762817E+01 4.0477276E+01
+ 53-7.9762817E+01 4.5015804E+01
+ 56-7.4689911E+01 3.9719700E+01
+ 59-7.4689911E+01 4.2516014E+01
+ 57-8.0520103E+01 3.9719700E+01
+ 58-8.0520103E+01 4.2516014E+01
+ 61-8.1965126E+01 3.6497074E+01
+ 64-8.1965126E+01 3.9147400E+01
+ 62-8.9571434E+01 3.6497074E+01
+ 63-8.9571434E+01 3.9147400E+01
+ 66-7.5400520E+01 3.3752705E+01
+ 69-7.5400520E+01 3.6588001E+01
+ 67-8.4321953E+01 3.3752705E+01
+ 68-8.4321953E+01 3.6588001E+01
+ 71-8.1647064E+01 3.4982849E+01
+ 74-8.1647064E+01 3.6678066E+01
+ 72-9.0310204E+01 3.4982849E+01
+ 73-9.0310204E+01 3.6678066E+01
+ 76-7.5166809E+01 3.6540600E+01
+ 79-7.5166809E+01 3.9465916E+01
+ 77-8.3675499E+01 3.6540600E+01
+ 78-8.3675499E+01 3.9465916E+01
+ 81-7.7719315E+01 3.7201366E+01
+ 84-7.7719315E+01 4.0638737E+01
+ 82-8.2644859E+01 3.7201366E+01
+ 83-8.2644859E+01 4.0638737E+01
+ 86-8.4888321E+01 3.0144220E+01
+ 89-8.4888321E+01 3.5007942E+01
+ 87-8.8473198E+01 3.0144220E+01
+ 88-8.8473198E+01 3.5007942E+01
+ 91-7.9974541E+01 2.4395878E+01
+ 94-7.9974541E+01 3.1000784E+01
+ 92-8.7634949E+01 2.4395878E+01
+ 93-8.7634949E+01 3.1000784E+01
+ 96-8.0742737E+01 3.0355408E+01
+ 99-8.0742737E+01 3.5000683E+01
+ 97-8.5605202E+01 3.0355408E+01
+ 98-8.5605202E+01 3.5000683E+01
+ 101-8.8097847E+01 3.0145893E+01
+ 104-8.8097847E+01 3.4996025E+01
+ 102-9.1654884E+01 3.0145893E+01
+ 103-9.1654884E+01 3.4996025E+01
+ 106-7.8499565E+01 3.2046623E+01
+ 109-7.8499565E+01 3.5215424E+01
+ 107-8.3354073E+01 3.2046623E+01
+ 108-8.3354073E+01 3.5215424E+01
+ 111-8.7019890E+01 3.6970249E+01
+ 114-8.7019890E+01 4.2508301E+01
+ 112-9.1512924E+01 3.6970249E+01
+ 113-9.1512924E+01 4.2508301E+01
+ 116-8.4784630E+01 3.7771702E+01
+ 119-8.4784630E+01 4.1761333E+01
+ 117-8.8097855E+01 3.7771702E+01
+ 118-8.8097855E+01 4.1761333E+01
+ 121-8.2123062E+01 4.1696041E+01
+ 124-8.2123062E+01 4.8306194E+01
+ 122-9.0417961E+01 4.1696041E+01
+ 123-9.0417961E+01 4.8306194E+01
+ 126-8.0518906E+01 3.8403103E+01
+ 129-8.0518906E+01 4.2327076E+01
+ 127-8.4820259E+01 3.8403103E+01
+ 128-8.4820259E+01 4.2327076E+01
+ 131-8.6249451E+01 4.2491699E+01
+ 134-8.6249451E+01 4.7309910E+01
+ 132-9.2889221E+01 4.2491699E+01
+ 133-9.2889221E+01 4.7309910E+01
+ 136-9.0139938E+01 4.0375393E+01
+ 139-9.0139938E+01 4.3501232E+01
+ 137-9.6639389E+01 4.0375393E+01
+ 138-9.6639389E+01 4.3501232E+01
+ 141-9.4589706E+01 3.6993061E+01
+ 144-9.4589706E+01 4.0003178E+01
+ 142-1.0205131E+02 3.6993061E+01
+ 143-1.0205131E+02 4.0003178E+01
+ 146-8.9483299E+01 4.3499401E+01
+ 149-8.9483299E+01 4.9384365E+01
+ 147-9.7238861E+01 4.3499401E+01
+ 148-9.7238861E+01 4.9384365E+01
+ 151-8.9098778E+01 3.5995613E+01
+ 154-8.9098778E+01 4.0613605E+01
+ 152-9.5774429E+01 3.5995613E+01
+ 153-9.5774429E+01 4.0613605E+01
+ 156-9.5308029E+01 4.0000000E+01
+ 159-9.5308029E+01 4.3001740E+01
+ 157-1.0405301E+02 4.0000000E+01
+ 158-1.0405301E+02 4.3001740E+01
+ 161-9.6554161E+01 4.5935059E+01
+ 164-9.6554161E+01 4.9000702E+01
+ 162-1.0404842E+02 4.5935059E+01
+ 163-1.0404842E+02 4.9000702E+01
+ 166-9.6436279E+01 4.2479641E+01
+ 169-9.6436279E+01 4.5945454E+01
+ 167-1.0405725E+02 4.2479641E+01
+ 168-1.0405725E+02 4.5945454E+01
+ 171-8.9644760E+01 3.3003983E+01
+ 174-8.9644760E+01 3.6499542E+01
+ 172-9.4617699E+01 3.3003983E+01
+ 173-9.4617699E+01 3.6499542E+01
+ 176-8.8758369E+01 2.8854889E+01
+ 179-8.8758369E+01 3.3019409E+01
+ 177-9.4043159E+01 2.8854889E+01
+ 178-9.4043159E+01 3.3019409E+01
+ 181-9.4431000E+01 3.3615650E+01
+ 184-9.4431000E+01 3.7002300E+01
+ 182-1.0300217E+02 3.3615650E+01
+ 183-1.0300217E+02 3.7002300E+01
+ 186-9.3507957E+01 2.5837017E+01
+ 189-9.3507957E+01 3.6500679E+01
+ 187-1.0664510E+02 2.5837017E+01
+ 188-1.0664510E+02 3.6500679E+01
+ 191-1.1104272E+02 4.1988091E+01
+ 194-1.1104272E+02 4.9001198E+01
+ 192-1.1724202E+02 4.1988091E+01
+ 193-1.1724202E+02 4.9001198E+01
+ 196-1.0403907E+02 4.4358299E+01
+ 199-1.0403907E+02 4.9001415E+01
+ 197-1.1604900E+02 4.4358299E+01
+ 198-1.1604900E+02 4.9001415E+01
+ 201-1.1646229E+02 4.1991901E+01
+ 204-1.1646229E+02 4.6299274E+01
+ 202-1.2470231E+02 4.1991901E+01
+ 203-1.2470231E+02 4.6299274E+01
+ 206-1.1691460E+02 4.5543701E+01
+ 209-1.1691460E+02 4.9002651E+01
+ 207-1.2484763E+02 4.5543701E+01
+ 208-1.2484763E+02 4.9002651E+01
+ 211-1.0405155E+02 4.0994801E+01
+ 214-1.0405155E+02 4.5005955E+01
+ 212-1.1105611E+02 4.0994801E+01
+ 213-1.1105611E+02 4.5005955E+01
+ 216-1.0904457E+02 3.1332079E+01
+ 219-1.0904457E+02 3.7004265E+01
+ 217-1.1481580E+02 3.1332079E+01
+ 218-1.1481580E+02 3.7004265E+01
+ 221-1.1413043E+02 3.2528774E+01
+ 224-1.1413043E+02 4.2009655E+01
+ 222-1.2448083E+02 3.2528774E+01
+ 223-1.2448083E+02 4.2009655E+01
+ 226-1.0204103E+02 3.6992416E+01
+ 229-1.0204103E+02 4.1003479E+01
+ 227-1.0905959E+02 3.6992416E+01
+ 228-1.0905959E+02 4.1003479E+01
+ 231-1.1403880E+02 3.5002083E+01
+ 234-1.1403880E+02 4.2002300E+01
+ 232-1.2000472E+02 3.5002083E+01
+ 233-1.2000472E+02 4.2002300E+01
+ 236-1.0300148E+02 3.1332066E+01
+ 239-1.0300148E+02 3.7000275E+01
+ 237-1.0904956E+02 3.1332066E+01
+ 238-1.0904956E+02 3.7000275E+01
+ 241-1.0904039E+02 3.6997906E+01
+ 244-1.0904039E+02 4.2001678E+01
+ 242-1.1405219E+02 3.6997906E+01
+ 243-1.1405219E+02 4.2001678E+01
+EOI
+EOS
diff --git a/inst/share/gshhs_c.b b/inst/share/gshhs_c.b
new file mode 100644
index 0000000..35b9a09
Binary files /dev/null and b/inst/share/gshhs_c.b differ
diff --git a/inst/share/nc_xtra.dbf b/inst/share/nc_xtra.dbf
new file mode 100644
index 0000000..6a2899e
Binary files /dev/null and b/inst/share/nc_xtra.dbf differ
diff --git a/inst/share/wdb_borders_c.b b/inst/share/wdb_borders_c.b
new file mode 100644
index 0000000..7afbb2f
Binary files /dev/null and b/inst/share/wdb_borders_c.b differ
diff --git a/man/ContourLines2SLDF.Rd b/man/ContourLines2SLDF.Rd
new file mode 100644
index 0000000..bfe1d21
--- /dev/null
+++ b/man/ContourLines2SLDF.Rd
@@ -0,0 +1,51 @@
+\name{ContourLines2SLDF}
+\alias{ArcObj2SLDF}
+\alias{ContourLines2SLDF}
+\alias{MapGen2SL}
+
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Converter functions to build SpatialLinesDataFrame objects}
+\description{
+ These functions show how to build converters to SpatialLinesDataFrame objects:
+\code{ArcObj2SLDF} from the list returned by the \code{get.arcdata} function in the RArcInfo package; \code{ContourLines2SLDF} from the list returned by the \code{contourLines} function in the graphics package (here the data frame is just the contour levels, with one Lines object made up of at least one Line object per level); and \code{MapGen2SL} reads a file in "Mapgen" format into a \code{SpatialLines} object.
+}
+\usage{
+ArcObj2SLDF(arc, proj4string=CRS(as.character(NA)), IDs)
+ContourLines2SLDF(cL, proj4string=CRS(as.character(NA)))
+MapGen2SL(file, proj4string=CRS(as.character(NA)))
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{arc}{a list returned by the \code{get.arcdata} function in the RArcInfo package}
+ \item{IDs}{vector of unique character identifiers; if not given, suitable defaults will be used, and the same values inserted as data slot row names}
+ \item{cL}{a list returned by the \code{contourLines} function in the graphics package}
+ \item{proj4string}{Object of class \code{"CRS"}; see \link[sp]{CRS-class}}
+ \item{file}{filename of a file containing a Mapgen line data set}
+}
+
+\value{
+ A SpatialLinesDataFrame object
+}
+
+\author{ Roger Bivand; Edzer Pebesma }
+
+\note{Coastlines of varying resolution may be chosen online and downloaded in "Mapgen" text format from \url{http://www.ngdc.noaa.gov/mgg/shorelines/shorelines.html}, most conveniently using the interactive selection tool, but please note the 500,000 point limit on downloads, which is easy to exceed.}
+
+
+\seealso{ \link[sp]{SpatialLines-class} }
+\examples{
+#data(co37_d90_arc) # retrieved as:
+# library(RArcInfo)
+# fl <- "http://www.census.gov/geo/cob/bdy/co/co90e00/co37_d90_e00.zip"
+# download.file(fl, "co37_d90_e00.zip")
+# e00 <- zip.file.extract("co37_d90.e00", "co37_d90_e00.zip")
+# e00toavc(e00, "ncar")
+# arc <- get.arcdata(".", "ncar")
+#res <- arcobj2SLDF(arc)
+#plot(res)
+#invisible(title(""))
+res <- ContourLines2SLDF(contourLines(volcano))
+plot(res, col=terrain.colors(nrow(as(res, "data.frame"))))
+title("Volcano contours as SpatialLines")
+}
+\keyword{spatial}
diff --git a/man/GE_SpatialGrid.Rd b/man/GE_SpatialGrid.Rd
new file mode 100644
index 0000000..075186c
--- /dev/null
+++ b/man/GE_SpatialGrid.Rd
@@ -0,0 +1,66 @@
+\name{GE_SpatialGrid}
+\alias{GE_SpatialGrid}
+\alias{Sobj_SpatialGrid}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Create SpatialGrid for PNG output to GE}
+\description{
+ The function sets up metadata in the form of a SpatialGrid object for defining the size and placing of a PNG image overlay in Google Earth. The internal function \code{Sobj\_SpatialGrid} can also be called to build a grid for arbitrary Spatial* objects.
+}
+\usage{
+GE_SpatialGrid(obj, asp = NA, maxPixels = 600)
+Sobj_SpatialGrid(obj, asp=1, maxDim=100, n=NULL)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{obj}{a Spatial* object}
+ \item{asp}{if NA, will be set to the latitude corrected value}
+ \item{maxPixels}{the maximum dimension of the output PNG}
+ \item{maxDim}{the maximum dimension of the output grid; ignored if \code{n} not NULL}
+ \item{n}{if not NULL, the minimum number of cells in the returned grid}
+}
+\details{
+ The function is used together with \code{kmlOverlay} to wrap around the opening of a PNG graphics device, plotting code, and the closing of the device. The computed values take account of the adjustment of the actual data bounding box to an integer number of rows and columns in the image file.
+
+The approach may be used as an alternative to writing PNG files from SpatialGrid and SpatialPixel objects in \pkg{rgdal} using \code{writeGDAL}, and to writing KML files using \code{writeOGR} for vector data objects. The output PNG files are likely to be very much smaller than large vector data KML files, and hinder the retrieval of exact positional information.
+}
+\value{
+ returns an S3 object of class \code{\dQuote{GE_SG}} with components:
+ \item{height}{Integer raster height for png call}
+ \item{width}{Integer raster width for png call}
+ \item{SG}{a SpatialGrid object with the grid topology of the output PNG}
+ \item{asp}{the aspect value used}
+ \item{xlim}{xlim taken from SG}
+ \item{ylim}{ylim taken from SG}
+}
+\author{Duncan Golicher, David Forrest and Roger Bivand}
+\seealso{\code{\link{kmlOverlay}}}
+\examples{
+opt_exask <- options(example.ask=FALSE)
+qk <- SpatialPointsDataFrame(quakes[, c(2:1)], quakes)
+summary(Sobj_SpatialGrid(qk)$SG)
+t2 <- Sobj_SpatialGrid(qk, n=10000)$SG
+summary(t2)
+prod(slot(slot(t2, "grid"), "cells.dim"))
+proj4string(qk) <- CRS("+proj=longlat")
+tf <- tempfile()
+SGqk <- GE_SpatialGrid(qk)
+png(file=paste(tf, ".png", sep=""), width=SGqk$width, height=SGqk$height,
+ bg="transparent")
+par(mar=c(0,0,0,0), xaxs="i", yaxs="i")
+plot(qk, xlim=SGqk$xlim, ylim=SGqk$ylim, setParUsrBB=TRUE)
+dev.off()
+kmlOverlay(SGqk, paste(tf, ".kml", sep=""), paste(tf, ".png", sep=""))
+\dontrun{
+qk0 <- quakes
+qk0$long <- ifelse(qk0$long <= 180, qk0$long, qk0$long-360)
+qk0a <- SpatialPointsDataFrame(qk0[, c(2:1)], qk0)
+proj4string(qk0a) <- CRS("+proj=longlat")
+writeOGR(qk0a, paste(tf, "v.kml", sep=""), "Quakes", "KML")
+system(paste("googleearth ", tf, ".kml", sep=""))
+}
+options(example.ask=opt_exask)
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{spatial}
+
diff --git a/man/Map2poly.Rd b/man/Map2poly.Rd
new file mode 100644
index 0000000..af16940
--- /dev/null
+++ b/man/Map2poly.Rd
@@ -0,0 +1,92 @@
+% Copyright 2003 by Roger S. Bivand
+\encoding{latin1}
+\name{Map2poly}
+\alias{Map2poly}
+\alias{Map2poly1}
+\alias{Map2lines}
+\alias{Map2points}
+%\alias{Map2maplim}
+\alias{Map2bbs}
+\alias{MapShapeIds}
+\alias{shape2poly}
+\alias{shape2lines}
+\alias{shape2points}
+%\alias{shp2maplim}
+\alias{shape2bbs}
+\alias{convert.pl}
+%\alias{ringDir}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Create polygon lists and bounding boxes from imported shapefiles}
+\description{
+ Map2poly() is a function to make imported GIS vector polygons into a "polylist" object from a "Map" object. Map2bbs() retrieves polygon bounding boxes; analogous functions for the "shapefiles" package are shape2poly() and shape2bbs() (thanks to St�phane Dray for his contribution); convert.pl() serves to convert the deprecated "multipart" "polylist" format to an NA-separated format now used by plot() for polylist objects and poly2nb().
+%\code{ringDir()} attempts to find out whether polygon ring
+%coordinates run clockwise (external boundary of polygon object), or
+%anti-clockwise (internal boundary - hole).
+\code{*2lines()} and \code{*2points()} do the same as \code{*2poly()} for shapefiles of types 3=lines and 1=points; polygons are type=5.
+}
+\usage{
+Map2poly1(Map, region.id = NULL, raw=TRUE)
+Map2poly(Map, region.id = NULL, quiet=TRUE)
+Map2lines(Map)
+Map2points(Map)
+%Map2maplim(Map)
+Map2bbs(Map)
+MapShapeIds(Map)
+shape2poly(shape, region.id = NULL)
+shape2lines(shape)
+shape2points(shape)
+%shp2maplim(shape)
+shape2bbs(shape)
+convert.pl(pl)
+%ringDir(xy, ring)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{Map}{object of class \code{"Map"}, imported from a GIS polygon vector file}
+ \item{shape}{list returned by \code{read.shapefile()}, imported from a GIS polygon vector file using the package "shapefiles"}
+ \item{region.id}{character vector of region ids to be added to the neighbours list as attribute \code{region.id}}
+ \item{raw}{default TRUE \emph{until next release}, if TRUE, do not run sanity check for ring directions implying holes in no surrounding polygon}
+ \item{quiet}{if TRUE, suppress reports of ring direction changes}
+ \item{pl}{list of old-style multipart polygons of class \code{polylist}}
+% \item{xy}{the coordinate object for a single member of a polygon list}
+% \item{ring}{the ring (one of \code{1:attr(xy, "nParts"))} index number}
+}
+\details{
+ From release 0.4-12, \code{Map2poly} replaces the plotting order heuristic with plotting only in strict decreasing order of top-level (multi)polygon area. In multipolygons, the components are plotted in decreasing area order. The multpolygons themselves are assigned their area sum for plotting order. Ring directions are all set to clockwise - very many shapefiles have been observed with quite unrealistic ring orders, so respecting input ring orders seems worse than imposing uniformity. [...]
+ From release 0.4-1, \code{Map2poly} tries to determine a plotting order for multiple parts of a single polygon object, and for lists of polygon objects to avoid overplotting. It also tries to respect the ESRI-stipulated rule that lakes are anti-clockwise and islands are clockwise: \url{http://shapelib.maptools.org/dl/shapefile.pdf}: "The order of vertices or orientation for a ring indicates which side of the ring is the interior of the polygon. The neighborhood to the right of an obser [...]
+}
+
+\value{
+ \code{Map2poly}, \code{shape2poly}, \code{convert.pl} return polylist objects, lists of polygon boundary coordinates (divided by NA where the polygon object is represented by more than one polygon) with many attributes;
+ \code{Map2lines}, \code{shape2lines} return lineslist objects;
+ \code{Map2points}, \code{shape2points} return (n x 2) matrices; and
+ \code{Map2bbs}, \code{shape2bbs} return bounding box matrixes, c(x1, y1, x2, y2) with coordinates for the lower left corner and upper right corner.
+}
+
+\author{Roger Bivand and St�phane Dray, \email{Roger.Bivand at nhh.no}}
+
+\seealso{\code{\link{read.shape}}, \code{\link[shapefiles]{read.shapefile}}}
+
+
+\examples{
+try2 <- read.shape(system.file("shapes/columbus.shp", package="maptools")[1])
+mappolys <- Map2poly(try2, as.character(try2$att.data$NEIGNO), quiet=FALSE)
+plot(mappolys)
+title(main="Polygons for Columbus OH from maptools package")
+mappolys <- Map2poly1(try2, as.character(try2$att.data$NEIGNO), raw=FALSE)
+plot(mappolys)
+title(main="Polygons for Columbus OH from maptools package")
+try3 <- read.shape(system.file("shapes/baltim.shp", package="maptools")[1])
+baltpts <- Map2points(try3)
+xylims <- attr(baltpts, "maplim")
+plot(xylims$x, xylims$y, asp=1, type='n', xlab="", ylab="")
+points(baltpts)
+title(main="Baltimore points from maptools package")
+try4 <- read.shape(system.file("shapes/fylk-val.shp", package="maptools")[1])
+fylk.val <- Map2lines(try4)
+xylims <- attr(fylk.val, "maplim")
+plot(xylims$x, xylims$y, asp=1, type='n', xlab="", ylab="")
+for (i in 1:length(fylk.val)) lines(fylk.val[[i]])
+title(main="Norwegian river centrelines from maptools package")
+}
+\keyword{spatial}
diff --git a/man/Rgshhs.Rd b/man/Rgshhs.Rd
new file mode 100644
index 0000000..bdc3893
--- /dev/null
+++ b/man/Rgshhs.Rd
@@ -0,0 +1,70 @@
+\name{Rgshhs}
+\alias{Rgshhs}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Read GSHHS data into sp object}
+\description{
+ If the data are polygon data, the function will read GSHHS polygons into SpatialPolygons object for a chosen region, using binary shorelines from Global Self-consistant Hierarchical High-resolution Shorelines, release 1.11 of July 3, 2008 (\url{ftp://ftp.soest.hawaii.edu/pwessel/gshhs/gshhs_1.11.zip}). If the data are line data, the borders or river lines will be read into a SpatialLines object. The data are provided in integer form as millionths of decimal degrees. Reading of much ear [...]
+}
+\usage{
+Rgshhs(fn, xlim = NULL, ylim = NULL, level = 4, minarea = 0, shift=FALSE,
+verbose = TRUE, no.clip = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{fn}{filename or full path to GSHHS 1.11 file to be read}
+ \item{xlim}{longitude limits within 0-360 in most cases, negative longitudes are also found east of the Atlantic, but the Americas are recorded as positive values}
+ \item{ylim}{latitude limits}
+ \item{level}{maximum GSHHS level to include, defaults to 4 (everything), setting 1 will only retrieve land, no lakes}
+ \item{minarea}{minimum area in square km to retrieve, default 0}
+ \item{shift}{default FALSE, can be used to shift longitudes > 180 degrees to below zero, beware of artefacts involving unhandled polygon splitting at 180 degrees}
+ \item{verbose}{default TRUE, print progress reports}
+ \item{no.clip}{default FALSE, if TRUE, do not clip output polygons to bounding box}
+}
+
+\details{
+ The package is distributed with the coarse version of the shoreline data, and much more detailed versions may be downloaded from the referenced websites. The data is of high quality, matching the accuracy of SRTM shorelines for the full dataset (but not for inland waterbodies). In general, users will construct study region SpatialPolygons objects, which can then be exported (for example as a shapefile), or used in other R packages (such as PBSmapping). The largest land polygons take co [...]
+}
+
+\value{
+ for polygon data, a list with the following components:
+ \item{polydata}{data from the headers of the selected GSHHS polygons}
+ \item{belongs}{a matrix showing which polygon belongs to (is included in) which polygon, going from the highest level among the selected polygons down to 1 (land); levels are: 1 land, 2 lake, 3 island\_in\_lake, 4 pond\_in\_island\_in\_lake.}
+ \item{new_belongs}{a ragged list of polygon inclusion used for making SP}
+ \item{SP}{a SpatialPolygons object; this is the principal output object, and will become the only output object as the package matures}
+ for line data, a list with the following component:
+ \item{SP}{a SpatialLines object}
+}
+\references{\url{http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html},
+
+
+\url{http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html} (only old format - use for information only); data downloaded from
+
+\url{ftp://ftp.soest.hawaii.edu/pwessel/gshhs/gshhs_1.10.zip}; Wessel, P., and W. H. F. Smith, A Global Self-consistent, Hierarchical, High-resolution Shoreline Database, J. Geophys. Res., 101, 8741-8743, 1996.}
+\author{Roger Bivand}
+
+\note{
+ A number of steps are taken in this implementation that are unexpected, print messages, and so require explanation. Following the extraction of polygons intersecting the required region, a check is made to see if Antarctica is present. If it is, a new southern border is imposed at the southern ylim value or -90 if no ylim value is given. When clipping polygons seeming to intersect the required region boundary, it can happen that no polygon is left within the region (for example when th [...]
+
+Please also note that limitations on the use of gpclib are very unclear, as exactly the same GPC code is included in the GPL'ed PBSmapping package on CRAN.
+}
+
+\examples{
+gshhs.c.b <- system.file("share/gshhs_c.b", package="maptools")
+NZx <- c(160,180)
+NZy <- c(-50,-30)
+NZ <- Rgshhs(gshhs.c.b, xlim=NZx, ylim=NZy)
+plot(NZ$SP, col="khaki", pbg="azure2", xlim=NZx, ylim=NZy, xaxs="i", yaxs="i", axes=TRUE)
+GLx <- c(265,285)
+GLy <- c(40,50)
+GL <- Rgshhs(gshhs.c.b, xlim=GLx, ylim=GLy)
+plot(GL$SP, col="khaki", pbg="azure2", xlim=GLx, ylim=GLy, xaxs="i", yaxs="i", axes=TRUE)
+BNLx <- c(2,8)
+BNLy <- c(49,54)
+wdb_lines <- system.file("share/wdb_borders_c.b", package="maptools")
+BNLp <- Rgshhs(gshhs.c.b, xlim=BNLx, ylim=BNLy)
+BNLl <- Rgshhs(wdb_lines, xlim=BNLx, ylim=BNLy)
+plot(BNLp$SP, col="khaki", pbg="azure2", xlim=BNLx, ylim=BNLy, xaxs="i", yaxs="i", axes=TRUE)
+lines(BNLl$SP)
+}
+\keyword{spatial}
+
diff --git a/man/SpatialLines2PolySet.Rd b/man/SpatialLines2PolySet.Rd
new file mode 100644
index 0000000..b3c462d
--- /dev/null
+++ b/man/SpatialLines2PolySet.Rd
@@ -0,0 +1,59 @@
+\name{SpatialLines2PolySet}
+\alias{SpatialLines2PolySet}
+\alias{SpatialPolygons2PolySet}
+\alias{PolySet2SpatialPolygons}
+\alias{PolySet2SpatialLines}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Convert sp line and polygon objects to PBSmapping PolySet objects}
+\description{
+ Functions \code{SpatialLines2PolySet} and \code{SpatialPolygons2PolySet} convert objects of sp classes to \code{PolySet} class objects as defined in the PBSmapping package, and \code{PolySet2SpatialLines} and \code{PolySet2SpatialPolygons} convert in the opposite direction.
+}
+\usage{
+SpatialLines2PolySet(SL)
+SpatialPolygons2PolySet(SpP)
+PolySet2SpatialLines(PS)
+PolySet2SpatialPolygons(PS, close_polys=TRUE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{SL}{a SpatialLines object as defined in the sp package}
+ \item{SpP}{a SpatialPolygons object as defined in the sp package}
+ \item{PS}{a PolySet object}
+ \item{close_polys}{should polygons be closed if open}
+}
+
+\value{
+ PolySet objects as defined in the PBSmapping package
+}
+
+\author{Roger Bivand and Andrew Niccolai}
+
+
+\seealso{\code{\link[PBSmapping]{as.PolySet}}, \code{\link{MapGen2SL}}}
+
+\examples{
+library(PBSmapping)
+library(maps)
+nor_coast_lines <- map("world", interior=FALSE, plot=FALSE, xlim=c(4,32),
+ ylim=c(58,72))
+nor_coast_lines <- pruneMap(nor_coast_lines, xlim=c(4,32), ylim=c(58,72))
+nor_coast_lines_sp <- map2SpatialLines(nor_coast_lines,
+ proj4string=CRS("+proj=longlat +datum=wgs84"))
+nor_coast_lines_PS <- SpatialLines2PolySet(nor_coast_lines_sp)
+summary(nor_coast_lines_PS)
+plotLines(nor_coast_lines_PS)
+o3 <- PolySet2SpatialLines(nor_coast_lines_PS)
+plot(o3, axes=TRUE)
+nor_coast_poly <- map("world", "norway", fill=TRUE, col="transparent",
+ plot=FALSE, ylim=c(58,72))
+IDs <- sapply(strsplit(nor_coast_poly$names, ":"), function(x) x[1])
+nor_coast_poly_sp <- map2SpatialPolygons(nor_coast_poly, IDs=IDs,
+ proj4string=CRS("+proj=longlat +datum=wgs84"))
+nor_coast_poly_PS <- SpatialPolygons2PolySet(nor_coast_poly_sp)
+summary(nor_coast_poly_PS)
+plotPolys(nor_coast_poly_PS)
+o1 <- PolySet2SpatialPolygons(nor_coast_poly_PS)
+plot(o1, axes=TRUE)
+}
+\keyword{spatial}
+
diff --git a/man/as.ppp.Rd b/man/as.ppp.Rd
new file mode 100644
index 0000000..4b7e239
--- /dev/null
+++ b/man/as.ppp.Rd
@@ -0,0 +1,127 @@
+\name{as.ppp}
+\alias{as.owin.SpatialGridDataFrame}
+\alias{as.owin.SpatialPixelsDataFrame}
+\alias{as.owin.SpatialPolygons}
+\alias{as.im.SpatialGridDataFrame}
+\alias{coerce,SpatialGridDataFrame,owin-method}
+\alias{coerce,SpatialPixelsDataFrame,owin-method}
+\alias{coerce,SpatialPolygons,owin-method}
+\alias{coerce,SpatialGridDataFrame,im-method}
+\alias{as.ppp.SpatialGridDataFrame}
+\alias{as.ppp.SpatialPoints}
+\alias{as.ppp.SpatialPointsDataFrame}
+\alias{coerce,SpatialPoints,ppp-method}
+\alias{coerce,SpatialPointsDataFrame,ppp-method}
+\alias{as.psp.Line}
+\alias{as.psp.Lines}
+\alias{as.psp.SpatialLines}
+\alias{as.psp.SpatialLinesDataFrame}
+\alias{coerce,Line,psp-method}
+\alias{coerce,Lines,psp-method}
+\alias{coerce,SpatialLines,psp-method}
+\alias{coerce,SpatialLinesDataFrame,psp-method}
+\alias{coerce,im,SpatialGridDataFrame-method}
+\alias{coerce,ppp,SpatialGridDataFrame-method}
+\alias{coerce,ppp,SpatialPointsDataFrame-method}
+\alias{coerce,ppp,SpatialPoints-method}
+\alias{as.SpatialPointsDataFrame.ppp}
+\alias{as.SpatialGridDataFrame.ppp}
+\alias{as.SpatialPoints.ppp}
+\alias{as.SpatialGridDataFrame.im}
+
+\title{coercion between sp objects and spatstat objects}
+\description{
+S4-style as() coercion works from objects of S4 sp classes to spatstat S3 classes, but not the reverse. Coercion to sp classes uses direct function calls.
+}
+\section{Methods}{
+ \describe{
+\item{coerce}{\code{signature(from = "SpatialPoints", to = "ppp")}}
+\item{coerce}{\code{signature(from = "SpatialPointsDataFrame", to = "ppp")}}
+\item{coerce}{\code{signature(from = "Line", to = "psp")}}
+\item{coerce}{\code{signature(from = "Lines", to = "psp")}}
+\item{coerce}{\code{signature(from = "SpatialLines", to = "psp")}}
+\item{coerce}{\code{signature(from = "SpatialLinesDataFrame", to = "psp")}}
+\item{coerce}{\code{signature(from = "SpatialGridDataFrame", to = "ppp")}}
+\item{coerce}{\code{signature(from = "SpatialPolygons", to = "owin")}}
+\item{coerce}{\code{signature(from = "SpatialPixelsDataFrame", to = "owin")}}
+\item{coerce}{\code{signature(from = "SpatialGridDataFrame", to = "owin")}}
+\item{coerce}{\code{signature(from = "SpatialGridDataFrame", to = "im")}}
+\item{coerce}{\code{signature(from = "im", to = "SpatialGridDataFrame")}}
+\item{coerce}{\code{signature(from = "ppp", to = "SpatialGridDataFrame")}}
+\item{coerce}{\code{signature(from = "ppp", to = "SpatialPointsDataFrame")}}
+\item{coerce}{\code{signature(from = "ppp", to = "SpatialPoints")}}
+}
+}
+
+\usage{
+as.SpatialPoints.ppp(from)
+as.SpatialPointsDataFrame.ppp(from)
+as.SpatialGridDataFrame.ppp(from)
+as.SpatialGridDataFrame.im(from)
+as.psp.Line(from, ..., window=NULL, marks=NULL, fatal)
+as.psp.Lines(from, ..., window=NULL, marks=NULL, fatal)
+as.psp.SpatialLines(from, ..., window=NULL, marks=NULL, fatal)
+as.psp.SpatialLinesDataFrame(from, ..., window=NULL, marks=NULL, fatal)
+}
+\arguments{
+ \item{from}{object to coerce from}
+ \item{...}{other arguments to be passed through}
+ \item{window}{window as defined in the spatstat package}
+ \item{marks}{marks as defined in the spatstat package}
+ \item{fatal}{formal coercion argument}
+}
+\note{When coercing a SpatialPolygons object to an owin object, full
+topology checking is enabled by default. To avoid checking, set
+\code{spatstat.options(checkpolygons=FALSE)} (from spatstat (1.14-6)).
+To perform the checking later, \code{owinpolycheck(W, verbose=TRUE)}.}
+
+\author{Edzer Pebesma \email{e.pebesma at geo.uu.nl}, Roger Bivand}
+\examples{
+library(spatstat)
+data(meuse)
+coordinates(meuse) = ~x+y
+zn1 <- as(meuse["zinc"], "ppp")
+zn1
+plot(zn1)
+as(as(meuse, "SpatialPoints"), "ppp")
+data(meuse.grid)
+gridded(meuse.grid) = ~x+y
+mg_owin <- as(meuse.grid, "owin")
+zn1a <- ppp(x=zn1$x, y=zn1$y, marks=zn1$marks, window=mg_owin)
+zn1a
+plot(zn1a)
+rev_ppp_SP <- as.SpatialPoints.ppp(zn1a)
+summary(rev_ppp_SP)
+rev_ppp_SPDF <- as.SpatialPointsDataFrame.ppp(zn1a)
+summary(rev_ppp_SPDF)
+rev_ppp_SGDF <- as.SpatialGridDataFrame.ppp(zn1a)
+summary(rev_ppp_SGDF)
+data(meuse.riv)
+mr <- Line(meuse.riv)
+mr_psp <- as(mr, "psp")
+mr_psp
+plot(mr_psp)
+# as.owin(meuse.grid)
+# --- will only work if as.owin is method...
+mg_owin <- as(as(meuse.grid["ffreq"], "SpatialPixelsDataFrame"), "owin")
+mg_owin
+ho_sp <- SpatialPolygons(list(Polygons(list(Polygon(cbind(c(0,1,1,0,0),
+ c(0,0,1,1,0))), Polygon(cbind(c(0.6,0.4,0.4,0.6,0.6),
+ c(0.2,0.2,0.4,0.4,0.2)), hole=TRUE)), ID="ho")))
+plot(ho_sp, col="red", pbg="pink")
+ho <- as(ho_sp, "owin")
+plot(ho)
+pp <- runifpoint(500, win=ho)
+plot(pp)
+ho_orig <- owin(poly=list(list(x=c(0,1,1,0), y=c(0,0,1,1)),
+ list(x=c(0.6,0.4,0.4,0.6), y=c(0.2,0.2,0.4,0.4))))
+identical(ho, ho_orig)
+mg_dist <- meuse.grid["dist"]
+fullgrid(mg_dist) <- TRUE
+image(mg_dist, axes=TRUE)
+mg_im <- as(mg_dist, "im")
+plot(mg_im)
+mg2 <- as.SpatialGridDataFrame.im(mg_im)
+image(mg2, axes=TRUE)
+}
+\keyword{spatial}
diff --git a/man/asciigrid.Rd b/man/asciigrid.Rd
new file mode 100644
index 0000000..486a387
--- /dev/null
+++ b/man/asciigrid.Rd
@@ -0,0 +1,57 @@
+\name{readAsciiGrid}
+\alias{readAsciiGrid}
+\alias{writeAsciiGrid}
+\title{ read/write to/from (ESRI) asciigrid format }
+\description{ read/write to/from ESRI asciigrid format; a fuzz factor has been added to \code{writeAsciiGrid} to force cell resolution to equality if the difference is less than the square root of machine precision}
+\usage{
+readAsciiGrid(fname, as.image = FALSE, plot.image = FALSE,
+ colname = basename(fname), proj4string = CRS(as.character(NA)),
+ dec=options()$OutDec)
+writeAsciiGrid(x, fname, attr = 1, na.value = -9999, dec=options()$OutDec, ...)
+}
+
+\arguments{
+\item{fname}{ file name }
+\item{as.image}{logical; if TRUE, a list is returned, ready to be
+shown with the \code{image} command; if FALSE an object of
+class \link[sp]{SpatialGridDataFrame-class} is returned }
+\item{plot.image}{logical; if TRUE, an image of the map is plotted}
+\item{colname}{alternative name for data column if not file basename}
+\item{proj4string}{A CRS object setting the projection arguments of the Spatial Grid returned}
+\item{dec}{decimal point character. This should be a character string containing just one single-byte character --- see note below.}
+\item{x}{ object of class \link[sp]{SpatialGridDataFrame}}
+\item{attr}{attribute column; if missing, the first
+column is taken; a name or a column number may be given}
+\item{na.value}{numeric; value given to missing valued cells in the
+resulting map}
+\item{...}{ arguments passed to \link{write.table}, which is used
+to write the numeric data }
+}
+\value{
+ \code{readAsciiGrid} returns the grid map read; either as
+ an object of class \link[sp]{SpatialGridDataFrame-class} or, if
+ as.image is TRUE, as list with components \code{x}, \code{y} and \code{z}.
+}
+\note{In ArcGIS 8, it was not in general necessary to set the \code{dec} argument; it is not necessary in a mixed environment with ArcView 3.2 (R writes and ArcView reads "."), but inter-operation with ArcGIS 9 requires care because the defaults used by ArcGIS seem to be misleading, and it may be necessary to override what appear to be platform defaults by setting the argument.}
+\seealso{ \link[sp]{as.image.SpatialGridDataFrame}, \link[graphics]{image} }
+\author{Edzer J.\ Pebesma, e.pebesma at geo.uu.nl}
+\examples{
+x <- readAsciiGrid(system.file("grids/test.ag", package="maptools")[1])
+summary(x)
+image(x)
+xp <- as(x, "SpatialPixelsDataFrame")
+abline(h=332000, lwd=3)
+xpS <- xp[coordinates(xp)[,2] < 332000,]
+summary(xpS)
+xS <- as(xpS, "SpatialGridDataFrame")
+summary(xS)
+tmpfl <- paste(tempdir(), "testS.ag", sep="/")
+writeAsciiGrid(xS, tmpfl)
+axS <- readAsciiGrid(tmpfl)
+opar <- par(mfrow=c(1,2))
+image(xS, main="before export")
+image(axS, main="after import")
+par(opar)
+unlink(tmpfl)
+}
+\keyword{programming}
diff --git a/man/checkPolygonsHoles.Rd b/man/checkPolygonsHoles.Rd
new file mode 100644
index 0000000..b61d1c8
--- /dev/null
+++ b/man/checkPolygonsHoles.Rd
@@ -0,0 +1,61 @@
+\name{checkPolygonsHoles}
+\alias{checkPolygonsHoles}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Check holes in Polygons objects}
+\description{
+ The function checks holes in Polygons objects, using an intersection between a gpclib package gpc.poly object with one or more polygon contours and its bounding box to set the hole flag. The function will set single polygon contours to hole=FALSE, and if multiple polygon contours are holes, will set them TRUE.
+}
+\usage{
+checkPolygonsHoles(x)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{x}{An Polygons object as defined in package sp}
+}
+
+\value{
+ An Polygons object re-created from the input object.
+}
+
+\author{Roger Bivand}
+
+\examples{
+library(sp)
+library(gpclib)
+nc1 <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ proj4string=CRS("+proj=longlat +ellps=clrk66"))
+pl <- slot(nc1, "polygons")
+sapply(slot(pl[[4]], "Polygons"), function(x) slot(x, "hole"))
+pl[[4]] <- Polygons(list(slot(pl[[4]], "Polygons")[[1]],
+ Polygon(slot(slot(pl[[4]], "Polygons")[[2]], "coords"), hole=TRUE),
+ slot(pl[[4]], "Polygons")[[3]]), slot(pl[[4]], "ID"))
+sapply(slot(pl[[4]], "Polygons"), function(x) slot(x, "hole"))
+pl_new <- lapply(pl, checkPolygonsHoles)
+sapply(slot(pl_new[[4]], "Polygons"), function(x) slot(x, "hole"))
+srs <- slot(slot(pl[[1]], "Polygons")[[1]], "coords")
+hle2 <- structure(c(-81.64093, -81.38380, -81.34165, -81.66833, -81.64093,
+ 36.57865, 36.57234, 36.47603, 36.47894, 36.57865), .Dim = as.integer(c(5, 2)))
+hle3 <- structure(c(-81.47759, -81.39118, -81.38486, -81.46705, -81.47759,
+ 36.56289, 36.55659, 36.49907, 36.50380, 36.56289), .Dim = as.integer(c(5, 2)))
+x <- Polygons(list(Polygon(srs), Polygon(hle2), Polygon(hle3)),
+ ID=slot(pl[[1]], "ID"))
+sapply(slot(x, "Polygons"), function(x) slot(x, "hole"))
+res <- checkPolygonsHoles(x)
+sapply(slot(res, "Polygons"), function(x) slot(x, "hole"))
+\dontrun{
+opar <- par(mfrow=c(1,2))
+SPx <- SpatialPolygons(list(x))
+plot(SPx)
+text(coordinates(SPx),
+ labels=sapply(slot(x, "Polygons"), function(i) slot(i, "hole")), cex=0.6)
+title(xlab="Hole slot values before checking")
+SPres <- SpatialPolygons(list(res))
+plot(SPres)
+text(coordinates(SPres),
+ labels=sapply(slot(res, "Polygons"), function(i) slot(i, "hole")), cex=0.6)
+title(xlab="Hole slot values after checking")
+par(opar)
+}
+}
+\keyword{spatial}
+
diff --git a/man/dotsInPolys.Rd b/man/dotsInPolys.Rd
new file mode 100644
index 0000000..96c3f2f
--- /dev/null
+++ b/man/dotsInPolys.Rd
@@ -0,0 +1,61 @@
+\name{dotsInPolys}
+\alias{dotsInPolys}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Put dots in polygons}
+\description{
+ Make point coordinates for a dot density map
+}
+\usage{
+dotsInPolys(pl, x, f = "random", offset, compatible = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{pl}{list of polygons of class \code{polylist}, or an object of class SpatialPolygons or SpatialPolygonsDataFrame}
+ \item{x}{integer vector of counts of same length as pl for dots}
+ \item{f}{type of sampling used to place points in polygons, either "random" or "regular"}
+\item{offset}{ for regular sampling only: the offset (position) of the regular
+grid; if not set, \code{c(0.5,0.5)}, that is the returned grid is
+not random}
+ \item{compatible}{what to return, if TRUE a a list of matrices of point coordinates, one matrix for each member of pl, if false a SpatialPointsDataFrame with polygon ID values}
+}
+\details{
+ With f="random", the dots are placed in the polygon at random, f="regular" - in a grid pattern (number of dots not guaranteed to be the same as the count). When the polygon is made up of more than one part, the dots will be placed in proportion to the relative areas of the clockwise rings (anticlockwise are taken as holes). From maptools release 0.5-2, correction is made for holes in the placing of the dots, but depends on hole values being correctly set, which they often are not. The w [...]
+}
+\value{
+ If compatible=TRUE, the function returns a list of matrices of point coordinates, one matrix for each member of pl. If x[i] is zero, the list element is NULL, and can be tested when plotting - see the examples. If compatible=FALSE (default), it returns a SpatialPointsDataFrame with polygon ID values as the only column in the data slot.
+}
+
+\note{Waller and Gotway (2004) Applied Spatial Statistics for Public Health Data (Wiley, Hoboken, NJ) explicitly warn that care is needed in plotting and interpreting dot density maps (pp. 81-83)}
+
+\author{Roger Bivand \email{Roger.Bivand at nhh.no}}
+
+\seealso{\code{\link[sp]{spsample}}}
+\examples{
+x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])
+ncpolys <- Map2poly(x)
+try1 <- dotsInPolys(ncpolys, as.integer(x$att.data$SID74), compatible=TRUE)
+plot(ncpolys)
+xx <- lapply(try1, function(x) {if (!is.null(x)) points(as.matrix(rbind(x)),
+ pch=18, col="red")}) # added as.matrix(rbind(x)), thanks to Nicholas Grassly
+try2 <- dotsInPolys(ncpolys, as.integer(x$att.data$SID74), f="regular", compatible=TRUE)
+plot(ncpolys)
+xx <- lapply(try2, function(x) {if (!is.null(x)) points(as.matrix(rbind(x)),
+ pch=18, col="red")})
+nc_SP <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ proj4string=CRS("+proj=longlat +ellps=clrk66"))
+\dontrun{
+library(spgpc)
+pls <- slot(nc_SP, "polygons")
+pls_new <- lapply(pls, checkPolygonsHoles)
+nc_SP <- SpatialPolygonsDataFrame(SpatialPolygons(pls_new,
+ proj4string=CRS(proj4string(nc_SP))), data=as(nc_SP, "data.frame"))
+}
+try1 <- dotsInPolys(nc_SP, as.integer(nc_SP$SID74))
+plot(nc_SP, axes=TRUE)
+plot(try1, add=TRUE, pch=18, col="red")
+try2 <- dotsInPolys(nc_SP, as.integer(nc_SP$SID74), f="regular")
+plot(nc_SP, axes=TRUE)
+plot(try2, add=TRUE, pch=18, col="red")
+}
+\keyword{spatial}
+
diff --git a/man/elide-methods.Rd b/man/elide-methods.Rd
new file mode 100755
index 0000000..cbf172d
--- /dev/null
+++ b/man/elide-methods.Rd
@@ -0,0 +1,85 @@
+\name{elide-methods}
+\docType{methods}
+\alias{elide-methods}
+\alias{elide,SpatialPoints-method}
+\alias{elide,SpatialPointsDataFrame-method}
+\alias{elide,SpatialLines-method}
+\alias{elide,SpatialLinesDataFrame-method}
+\alias{elide,SpatialPolygons-method}
+\alias{elide,SpatialPolygonsDataFrame-method}
+\alias{elide}
+\title{Methods for Function elide in Package `maptools'}
+\description{
+ Methods for function \code{elide} to translate and disguise coordinate placing in the real world.
+}
+\section{Methods}{
+\describe{
+
+\item{obj = "SpatialPoints"}{elides object}
+
+\item{obj = "SpatialPointsDataFrame"}{elides object}
+
+\item{obj = "SpatialLines"}{elides object}
+
+\item{obj = "SpatialLinesDataFrame"}{elides object}
+
+\item{obj = "SpatialPolygons"}{elides object}
+
+\item{obj = "SpatialPolygonsDataFrame"}{elides object}
+}}
+
+\usage{
+elide(obj, ...)
+% (obj, bb=NULL, shift=c(0, 0), reflect=c(FALSE, FALSE), scale=NULL, flip=FALSE)
+}
+
+\arguments{
+ \item{obj}{object to be elided}
+ \item{...}{other arguments:
+ \describe{
+ \item{bb}{if NULL, uses bounding box of object, otherwise the given bounding box}
+ \item{shift}{values to shift the coordinates of the input object; this is made ineffective by the scale argument}
+ \item{reflect}{reverse coordinate axes}
+ \item{scale}{if NULL, coordinates not scaled; if TRUE, the longer dimension is scaled to lie within [0,1] and aspect maintained; if a scalar, the output range of [0,1] is multiplied by scale}
+ \item{flip}{translate coordinates on the main diagonal}
+ \item{rotate}{default 0, rotate angle degrees clockwise around center}
+ \item{center}{default NULL, if not NULL, the rotation center, numeric of length two}
+ \item{unitsq}{logical, default FALSE, if TRUE and scale TRUE, impose unit square bounding box (currently only points)}
+}}
+}
+
+\value{
+The methods return objects of the input class object with elided coordinates; the coordinate reference system is not set. Note that if the input coordinates or centroids are in the data slot data.frame of the input object, they should be removed before the use of these methods, otherwise they will betray the input positions.
+}
+\note{Rotation code kindly contributed by Don MacQueen}
+
+\examples{
+data(meuse)
+coordinates(meuse) <- c("x", "y")
+proj4string(meuse) <- CRS("+init=epsg:28992")
+data(meuse.riv)
+river_polygon <- Polygons(list(Polygon(meuse.riv)), ID="meuse")
+rivers <- SpatialPolygons(list(river_polygon))
+proj4string(rivers) <- CRS("+init=epsg:28992")
+rivers1 <- elide(rivers, reflect=c(TRUE, TRUE), scale=TRUE)
+meuse1 <- elide(meuse, bb=bbox(rivers), reflect=c(TRUE, TRUE), scale=TRUE)
+opar <- par(mfrow=c(1,2))
+plot(rivers, axes=TRUE)
+plot(meuse, add=TRUE)
+plot(rivers1, axes=TRUE)
+plot(meuse1, add=TRUE)
+par(opar)
+meuse1 <- elide(meuse, shift=c(10000, -10000))
+bbox(meuse)
+bbox(meuse1)
+rivers1 <- elide(rivers, shift=c(10000, -10000))
+bbox(rivers)
+bbox(rivers1)
+meuse1 <- elide(meuse, rotate=-30, center=apply(bbox(meuse), 1, mean))
+bbox(meuse)
+bbox(meuse1)
+plot(meuse1, axes=TRUE)
+}
+
+\keyword{methods}
+\keyword{spatial}
diff --git a/man/gcDestination.Rd b/man/gcDestination.Rd
new file mode 100755
index 0000000..9f244b7
--- /dev/null
+++ b/man/gcDestination.Rd
@@ -0,0 +1,56 @@
+\name{gcDestination}
+\alias{gcDestination}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Find destination in geographical coordinates}
+\description{
+ Find the destination in geographical coordinates at distance dist and for the given bearing from the starting point given by lon and lat.
+}
+\usage{
+gcDestination(lon, lat, bearing, dist, dist.units = "km",
+ model = NULL, Vincenty = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{lon}{longitude (Eastings) in decimal degrees (either scalar or vector)}
+ \item{lat}{latitude (Northings) in decimal degrees (either scalar or vector)}
+ \item{bearing}{bearing from 0 to 360 degrees (either scalar or vector)}
+ \item{dist}{distance travelled (scalar)}
+ \item{dist.units}{units of distance "km" (kilometers), "nm" (nautical miles), "mi" (statute miles)}
+ \item{model}{choice of ellipsoid model ("WGS84", "GRS80", "Airy", "International", "Clarke", "GRS67"}
+ \item{Vincenty}{logical flag, default FALSE}
+}
+\details{
+ The bearing argument may be a vector when lon and lat are scalar, representing a single point.
+}
+\value{
+ A matrix of decimal degree coordinates with Eastings in the first column and Northings in the second column.
+}
+\references{\url{http://www.movable-type.co.uk/scripts/latlong.html#ellipsoid},
+
+\url{http://williams.best.vwh.net/avform.htm},
+
+\url{http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html},
+
+Original reference \url{http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf}:
+
+Vincenty, T. 1975. Direct and inverse solutions of geodesics on
+the ellipsoid with application of nested equations.
+Survey Review 22(176):88-93}
+\author{Eric Archer and Roger Bivand}
+
+\seealso{\code{\link{gzAzimuth}}}
+\examples{
+data(state)
+res <- gcDestination(state.center$x, state.center$y, 45, 250, "km")
+plot(state.center$x, state.center$y, asp=1, pch=16)
+arrows(state.center$x, state.center$y, res[,1], res[,2], length=0.05)
+llist <- vector(mode="list", length=length(state.center$x))
+for (i in seq(along=llist)) llist[[i]] <- gcDestination(state.center$x[i],
+ state.center$y[i], seq(0, 360, 5), 250, "km")
+plot(state.center$x, state.center$y, asp=1, pch=3)
+nll <- lapply(llist, lines)
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{spatial}
+
diff --git a/man/get.Pcent.Rd b/man/get.Pcent.Rd
new file mode 100644
index 0000000..12fc920
--- /dev/null
+++ b/man/get.Pcent.Rd
@@ -0,0 +1,26 @@
+\name{get.Pcent}
+\alias{get.Pcent}
+\title{Polygon centroids}
+\description{
+ return the centroids of a map of polygons
+}
+\usage{
+get.Pcent(theMap)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{theMap}{a Map object returned by read.shape()}
+}
+
+\value{
+ a matrix of centroids.
+}
+
+\author{Nicholas J. Lewin-Koh, modified by Roger Bivand \email{Roger.Bivand at nhh.no}}
+
+\examples{
+x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])
+get.Pcent(x)
+}
+\keyword{spatial}
+
diff --git a/man/getKMLcoordinates.Rd b/man/getKMLcoordinates.Rd
new file mode 100644
index 0000000..77da526
--- /dev/null
+++ b/man/getKMLcoordinates.Rd
@@ -0,0 +1,38 @@
+\name{getKMLcoordinates}
+\alias{getKMLcoordinates}
+
+\title{Get a list of coordinates out of a KML file}
+
+\description{
+ This function parses a KML file to get the content of \code{<coordinates>} tags and returns a list of matrices representing the longitude-latitute or if \code{ignoreAltitude} is \code{FALSE} the longitude-latitute-altitude coordinates of a KML geometry.
+}
+
+\usage{
+coords <- getKMLcoordinates(kmlfile, ignoreAltitude=FALSE)
+}
+
+\arguments{
+ \item{kmlfile}{connection object or a character string of the KML file}
+ \item{ignoreAltitude}{if set to \code{TRUE} the altitude values of a KML points will be ignored}
+}
+
+\value{
+\code{coords} is a list of matrices representing the longitude-latitute or if \code{ignoreAltitude} is \code{FALSE} the longitude-latitute-altitude coordinates
+}
+
+\author{Hans-J. Bibiko}
+
+\seealso{\code{\link{kmlPolygon}}, \code{\link{kmlLine}}}
+\examples{
+data(wrld_simpl)
+## creates a KML file containing the polygons of South Africa (plus hole)
+sw <- slot(wrld_simpl[wrld_simpl$NAME=="South Africa",], "polygons")[[1]]
+tf <- tempfile()
+kmlPolygon(sw, kmlfile=tf, name="South Africa", col="#df0000aa", lwd=5,
+ border=4, kmlname="R Test",
+ kmldescription="This is <b>only</b> a <a href='http://www.r-project.org'>R</a> test.")
+zz <- getKMLcoordinates(tf, ignoreAltitude=TRUE)
+str(zz)
+}
+\keyword{spatial}
+
diff --git a/man/gzAzimuth.Rd b/man/gzAzimuth.Rd
new file mode 100644
index 0000000..6d650a1
--- /dev/null
+++ b/man/gzAzimuth.Rd
@@ -0,0 +1,44 @@
+\name{gzAzimuth}
+\alias{gzAzimuth}
+\alias{trackAzimuth}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Find azimuth for geographical coordinates}
+\description{
+ The function finds azimuth values for geographical coordinates given as decimal degrees from the \code{from} coordinates to the \code{to} coordinate. In function \code{trackAzimuth}, the azimuth values are found between successive rows of the input coordinate matrix.
+}
+\usage{
+gzAzimuth(from, to, type = "snyder_sphere")
+trackAzimuth(track, type="snyder_sphere")
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{from}{a two column matrix of geographical coordinates given as decimal degrees (longitude first)}
+ \item{track}{a two column matrix of geographical coordinates given as decimal degrees (longitude first)}
+ \item{to}{a one row, two column matrix or two element vector of geographical coordinates given as decimal degrees (longitude first)}
+ \item{type}{default is \code{"snyder_sphere"}, otherwise \code{"abdali"}; the results should be identical with slightly less trigonometry in \code{"abdali"}}
+}
+\details{
+ The azimuth is calculated on the sphere, using the formulae given by Snyder (1987, p. 30) and Abdali (1997, p. 17). The examples use data taken from Abdali (p. 17--18). There is a very interesting discussion of the centrality of azimuth-finding in the development of mathematics and mathematical geography in Abdali's paper. Among others, al-Khwarizmi was an important contributor. As Abdali puts it, "This is a veritable who's who of medieval science" (p. 3).
+}
+\value{
+ values in decimal degrees - zero is North - of the azimuth from the \code{from} coordinates to the \code{to} coordinate.
+}
+\references{Snyder JP (1987) Map projections - a working manual, USGS Professional Paper 1395; Abdali SK (1997) "The Correct Qibla", \url{http://patriot.net/users/abdali/ftp/qibla.pdf}}
+\author{Roger Bivand, with contributions by Sebastian Luque}
+
+\examples{
+name <- c("Mecca", "Anchorage", "Washington")
+long <- c(39.823333, -149.883333, -77.0166667)
+lat <- c(21.423333, 61.2166667, 38.9)
+x <- cbind(long, lat)
+rownames(x) <- name
+crib <- c(-9.098363, 56.575960)
+r1 <- gzAzimuth(x[2:3,], x[1,])
+r1
+all.equal(r1, crib)
+r2 <- gzAzimuth(x[2:3,], x[1,], type="abdali")
+r2
+all.equal(r2, crib)
+trackAzimuth(x)
+}
+\keyword{spatial}
diff --git a/man/holepolys.Rd b/man/holepolys.Rd
new file mode 100644
index 0000000..1b1b016
--- /dev/null
+++ b/man/holepolys.Rd
@@ -0,0 +1,47 @@
+\name{gpcholes}
+\alias{gpcholes}
+\alias{hole1pl}
+\alias{hole2pl}
+
+\docType{data}
+\title{Hisaji Ono's lake/hole problem}
+\description{
+ How to plot polygons with holes - holes are encoded by coordinates going anticlockwise, and overplotting is avoided by re-ordering the order in which polygons are plotted.
+}
+\usage{data(gpcholes)}
+\format{
+ The format is class \code{"polylist"}.
+}
+
+\details{
+
+"Date: Tue, 11 May 2004 12:54:20 +0900
+From: Hisaji ONO
+To: r-help
+
+ I've tried to create a polygon with one hole by gpclib using following
+example script.
+
+ holepoly <- read.polyfile(system.file("poly-ex/hole-poly.txt", package="gpclib"), nohole = FALSE)
+ area.poly(holepoly)
+ plot(holepoly,poly.args=list(col="red",border="blue"))
+
+ And I noticed plot function couldn't draw polygons with holes correctly.
+
+ Does anyone know how to solve this situation?"
+
+*(hole1pl has reversed the y component of polygon 1, to make its ring direction clockwise, hole2pl reverses the order of the two polygons in holepoly1 at pts)*
+
+}
+
+\source{
+ Data file included in "gpclib" package.
+}
+
+\examples{
+data(gpcholes)
+plot(hole2pl, col="red", pbg="white", border="blue", forcefill=FALSE)
+plot(hole1pl, col="red", pbg="white", border="blue", forcefill=FALSE)
+}
+
+\keyword{datasets}
diff --git a/man/kmlLine.Rd b/man/kmlLine.Rd
new file mode 100644
index 0000000..c45d402
--- /dev/null
+++ b/man/kmlLine.Rd
@@ -0,0 +1,69 @@
+\name{kmlLine}
+\alias{kmlLine}
+
+\title{Create and write a KML file on the basis of a given Lines object}
+\description{
+ The function is used to create and write a KML file on the basis of a given Lines object (a list of Line objects) for the usage in Google Earth resp. Google Maps.
+}
+\usage{
+kmlLine(obj=NULL, kmlfile=NULL,
+ name="R Line", description="", col=NULL, visibility=1, lwd=1,
+ kmlname="", kmldescription="")
+x <- kmlLine(obj=NULL,
+ name="R Line", description="", col=NULL, visibility=1, lwd=1,
+ kmlname="", kmldescription="")
+y <- kmlLine(kmlname="", kmldescription="")
+}
+
+\arguments{
+ \item{obj}{a \code{Lines} or \code{SpatialLinesDataFrame} object}
+ \item{kmlfile}{if not \code{NULL} the name as character string of the kml file to be written}
+ \item{name}{the name of the KML line}
+ \item{description}{the description of the KML line (HTML tags allowed)}
+ \item{col}{the stroke color (see also Color Specification) of the KML line}
+ \item{visibility}{if set to \code{1} or \code{TRUE} specifies that the KML line should be visible after loading}
+ \item{lwd}{the stroke width for the KML line}
+ \item{kmlname}{the name of the KML layer}
+ \item{kmldescription}{the description of the KML layer (HTML tags allowed)}
+}
+
+\details{
+ The function is used to convert a given \code{Lines} object (a list of Line objects) or the first \code{Lines} object listed in a passed \code{SpatialLinesDataFrame} object into KML line(s). If \code{kmlfile} is not \code{NULL} the result will be written into that file. If \code{kmlfile} is \code{NULL} the generated KML lines will be returned (see also value).
+
+For a passed \code{Lines} object the function generates a <Style> tag whereby its id attribute is set to the passed object's ID.
+
+The resulting KML line will be embedded in \code{<Placemark><MultiGeometry><LineString>}.
+}
+
+\value{
+x is a list with the elements \code{style} and \code{content} containing the generated lines of the KML file as character vectors if \code{kmlfile} is \code{NULL}.
+
+y is a list with the elements \code{header} and \code{footer} representing the KML file' header resp. footer if \code{obj} is \code{NULL}.
+}
+
+\section{Color Specification}{
+The following color specifications are allowed: \code{'red'}, \code{2}, or as hex code \code{'#RRGGBB'} resp. \code{'#RRGGBBAA'} for passing the alpha value.
+}
+
+\author{Hans-J. Bibiko}
+\seealso{\code{\link{kmlOverlay}}, \code{\link{kmlPolygon}}, \code{\link[sp]{Lines}}}
+
+\examples{
+xx <- readShapeSpatial(system.file("shapes/fylk-val-ll.shp",
+ package="maptools")[1], proj4string=CRS("+proj=longlat"))
+out <- sapply(slot(xx, "lines"), function(x) { kmlLine(x,
+ name=slot(x, "ID"), col="blue", lwd=1.5,
+ description=paste("river:", slot(x, "ID"))) })
+tf <- tempfile()
+kmlFile <- file(tf, "w")
+tf
+cat(kmlLine(kmlname="R Test", kmldescription="<i>Hello</i>")$header,
+ file=kmlFile, sep="\n")
+cat(unlist(out["style",]), file=kmlFile, sep="\n")
+cat(unlist(out["content",]), file=kmlFile, sep="\n")
+cat(kmlLine()$footer, file=kmlFile, sep="\n")
+close(kmlFile)
+}
+\concept{kml}
+\keyword{spatial}
+
diff --git a/man/kmlOverlay.Rd b/man/kmlOverlay.Rd
new file mode 100644
index 0000000..0c5ffa7
--- /dev/null
+++ b/man/kmlOverlay.Rd
@@ -0,0 +1,57 @@
+\name{kmlOverlay}
+\alias{kmlOverlay}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Create and write KML file for PNG image overlay}
+\description{
+ The function is used to create and write a KML file for a PNG image overlay for Google Earth.
+}
+\usage{
+kmlOverlay(obj, kmlfile = NULL, imagefile = NULL, name = "R image")
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{obj}{a \code{\dQuote{GE_SG}} object from \code{GE_SpatialGrid}}
+ \item{kmlfile}{if not NULL the name of the kml file to be written}
+ \item{imagefile}{the name of the PNG file containing the image - this should be either relative (same directory as kml file) or abosolute (fully qualified)}
+ \item{name}{the name used to describe the image overlay in GE}
+}
+\details{
+ The function is used together with \code{GE_SpatialGrid} to wrap around the opening of a PNG graphics device, plotting code, and the closing of the device. The computed values take account of the adjustment of the actual data bounding box to an integer number of rows and columns in the image file.
+
+The approach may be used as an alternative to writing PNG files from SpatialGrid and SpatialPixel objects in \pkg{rgdal} using \code{writeGDAL}, and to writing KML files using \code{writeOGR} for vector data objects. The output PNG files are likely to be very much smaller than large vector data KML files, and hinder the retrieval of exact positional information.
+
+}
+\value{
+x is a character vector containing the generated lines of the kml file
+}
+
+\author{Duncan Golicher, David Forrest and Roger Bivand}
+
+\seealso{\code{\link{GE_SpatialGrid}}}
+\examples{
+opt_exask <- options(example.ask=FALSE)
+qk <- SpatialPointsDataFrame(quakes[, c(2:1)], quakes)
+proj4string(qk) <- CRS("+proj=longlat")
+tf <- tempfile()
+SGqk <- GE_SpatialGrid(qk)
+png(file=paste(tf, ".png", sep=""), width=SGqk$width, height=SGqk$height,
+ bg="transparent")
+par(mar=c(0,0,0,0), xaxs="i", yaxs="i")
+plot(qk, xlim=SGqk$xlim, ylim=SGqk$ylim, setParUsrBB=TRUE)
+dev.off()
+kmlOverlay(SGqk, paste(tf, ".kml", sep=""), paste(tf, ".png", sep=""))
+\dontrun{
+library(rgdal)
+qk0 <- quakes
+qk0$long <- ifelse(qk0$long <= 180, qk0$long, qk0$long-360)
+qk0a <- SpatialPointsDataFrame(qk0[, c(2:1)], qk0)
+proj4string(qk0a) <- CRS("+proj=longlat")
+writeOGR(qk0a, paste(tf, "v.kml", sep=""), "Quakes", "KML")
+system(paste("googleearth ", tf, ".kml", sep=""))
+}
+options(example.ask=opt_exask)
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{spatial}
+
diff --git a/man/kmlPolygon.Rd b/man/kmlPolygon.Rd
new file mode 100755
index 0000000..077a3f6
--- /dev/null
+++ b/man/kmlPolygon.Rd
@@ -0,0 +1,86 @@
+\name{kmlPolygon}
+\alias{kmlPolygon}
+
+\title{Create and write a KML file on the basis of a given Polygons object}
+
+\description{
+ The function is used to create and write a KML file on the basis of a given Polygons object (a list of Polygon objects) for the usage in Google Earth resp. Google Maps.
+}
+
+\usage{
+kmlPolygon(obj=NULL, kmlfile=NULL,
+ name="R Polygon", description="", col=NULL, visibility=1, lwd=1, border=1,
+ kmlname="", kmldescription="")
+x <- kmlPolygon(obj=NULL,
+ name="R Polygon", description="", col=NULL, visibility=1, lwd=1, border=1,
+ kmlname="", kmldescription="")
+y <- kmlPolygon(kmlname="", kmldescription="")
+}
+
+\arguments{
+ \item{obj}{a \code{Polygons} or \code{SpatialPolygonsDataFrame} object}
+ \item{kmlfile}{if not \code{NULL} the name as character string of the kml file to be written}
+ \item{name}{the name of the KML polygon}
+ \item{description}{the description of the KML polygon (HTML tags allowed)}
+ \item{col}{the fill color (see also Color Specification) of the KML polygon}
+ \item{visibility}{if set to \code{1} or \code{TRUE} specifies that the KML polygon should be visible after loading}
+ \item{lwd}{the stroke width for the KML polygon}
+ \item{border}{the stroke color (see also Color Specification) for the KML polygon}
+ \item{kmlname}{the name of the KML layer}
+ \item{kmldescription}{the description of the KML layer (HTML tags allowed)}
+}
+
+\details{
+ The function is used to convert a given \code{Polygons} object (a list of Polygon objects) or the first \code{Polygons} object listed in a passed \code{SpatialPolygonsDataFrame} object into KML polygon. If \code{kmlfile} is not \code{NULL} the result will be written into that file. If \code{kmlfile} is \code{NULL} the generated KML lines will be returned (see also value).
+
+The conversion can also handle polygons which are marked as holes inside of the Polygons object if these holes are listed right after that polygon in which these holes appear. That implies that a given plot order set in the Polygons object will \bold{not} be considered.
+
+For a passed \code{Polygons} object the function generates a <Style> tag whereby its id attribute is set to the passed object's ID.
+
+The resulting KML polygon will be embedded in \code{<Placemark><MultiGeometry><Polygon>}.
+}
+
+\value{
+x is a list with the elements \code{style} and \code{content} containing the generated lines of the KML file as character vectors if \code{kmlfile} is \code{NULL}.
+
+y is a list with the elements \code{header} and \code{footer} representing the KML file' header resp. footer if \code{obj} is \code{NULL} (see second example).
+}
+
+\section{Color Specification}{
+The following color specifications are allowed: \code{'red'}, \code{2}, or as hex code \code{'#RRGGBB'} resp. \code{'#RRGGBBAA'} for passing the alpha value.
+}
+
+\author{Hans-J. Bibiko}
+
+\seealso{\code{\link{kmlOverlay}}, \code{\link{kmlLine}}, \code{\link[sp]{SpatialPolygons}}}
+
+\examples{
+data(wrld_simpl)
+## creates a KML file containing the polygons of South Africa (plus hole)
+sw <- slot(wrld_simpl[wrld_simpl$NAME=="South Africa",], "polygons")[[1]]
+tf <- tempfile()
+kmlPolygon(sw, kmlfile=tf, name="South Africa", col="#df0000aa", lwd=5,
+ border=4, kmlname="R Test",
+ kmldescription="This is <b>only</b> a <a href='http://www.r-project.org'>R</a> test.")
+tf
+
+## creates a KML file containing the polygons of South Africa, Switzerland, and Canada
+sw <- wrld_simpl[wrld_simpl$NAME \%in\% c("South Africa", "Switzerland", "Canada"),]
+out <- sapply(slot(sw, "polygons"), function(x) { kmlPolygon(x,
+ name=as(sw, "data.frame")[slot(x, "ID"), "NAME"],
+ col="red", lwd=1.5, border='black',
+ description=paste("ISO3:", slot(x, "ID"))) })
+tf <- tempfile()
+kmlFile <- file(tf, "w")
+tf
+cat(kmlPolygon(kmlname="R Test", kmldescription="<i>Hello</i>")$header,
+ file=kmlFile, sep="\n")
+cat(unlist(out["style",]), file=kmlFile, sep="\n")
+cat(unlist(out["content",]), file=kmlFile, sep="\n")
+cat(kmlPolygon()$footer, file=kmlFile, sep="\n")
+close(kmlFile)
+}
+
+\concept{kml}
+\keyword{spatial}
+
diff --git a/man/map2SpatialPolygons.Rd b/man/map2SpatialPolygons.Rd
new file mode 100644
index 0000000..aded664
--- /dev/null
+++ b/man/map2SpatialPolygons.Rd
@@ -0,0 +1,59 @@
+\name{map2SpatialPolygons}
+\alias{map2SpatialPolygons}
+\alias{map2SpatialLines}
+\alias{pruneMap}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Convert map objects to sp classes}
+\description{
+ These functions may be used to convert map objects returned by the map function in the maps package to suitable objects defined in the sp package. In the examples below, arguments are shown for retrieving first polygons by name, then lines by window.
+}
+\usage{
+map2SpatialPolygons(map, IDs, proj4string = CRS(as.character(NA)))
+map2SpatialLines(map, IDs=NULL, proj4string = CRS(as.character(NA)))
+pruneMap(map, xlim=NULL, ylim=NULL)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{map}{a map object defined in the maps package and returned by the map function}
+ \item{IDs}{Unique character ID values for each output Polygons object; the input IDs can be an integer or character vector with duplicates, where the duplicates will be combined as a single output Polygons object}
+ \item{proj4string}{Object of class \code{"CRS"};
+ holding a valid proj4 string}
+ \item{xlim,ylim}{limits for pruning a map object - should only be used for lines, because polygons will not be closed}
+}
+
+\value{
+ \code{map2SpatialPolygons} returns a SpatialPolygons object and \code{map2SpatialLines} returns a SpatialLines object (objects defined in the sp package); \code{pruneMap} returns a modified map object defined in the maps package
+}
+
+\author{Roger Bivand}
+
+\note{As the examples show, retrieval by name should be checked to see whether a window is not also needed: the "norway" polygons include "Norway:Bouvet Island", which is in the South Atlantic. Here, the IDs argument is set uniformly to "Norway" for all the component polygons, so that the output object contains a single Polygons object with multiple component Polygon objects. When retrieving by window, pruning may be needed on lines which are included because they begin within the window [...]
+
+\seealso{\code{\link[maps]{map}}}
+\examples{
+library(maps)
+nor_coast_poly <- map("world", "norway", fill=TRUE, col="transparent",
+ plot=FALSE)
+range(nor_coast_poly$x, na.rm=TRUE)
+range(nor_coast_poly$y, na.rm=TRUE)
+nor_coast_poly <- map("world", "norway", fill=TRUE, col="transparent",
+ plot=FALSE, ylim=c(58,72))
+nor_coast_poly$names
+IDs <- sapply(strsplit(nor_coast_poly$names, ":"), function(x) x[1])
+nor_coast_poly_sp <- map2SpatialPolygons(nor_coast_poly, IDs=IDs,
+ proj4string=CRS("+proj=longlat +datum=wgs84"))
+sapply(slot(nor_coast_poly_sp, "polygons"),
+ function(x) length(slot(x, "Polygons")))
+plot(nor_coast_poly_sp, col="grey", axes=TRUE)
+nor_coast_lines <- map("world", interior=FALSE, plot=FALSE, xlim=c(4,32),
+ ylim=c(58,72))
+plot(nor_coast_lines, type="l")
+nor_coast_lines <- pruneMap(nor_coast_lines, xlim=c(4,32), ylim=c(58,72))
+lines(nor_coast_lines, col="red")
+nor_coast_lines_sp <- map2SpatialLines(nor_coast_lines,
+ proj4string=CRS("+proj=longlat +datum=wgs84"))
+plot(nor_coast_poly_sp, col="grey", axes=TRUE)
+plot(nor_coast_lines_sp, col="blue", add=TRUE)
+}
+\keyword{spatial}
+
diff --git a/man/maptools.Rd b/man/maptools.Rd
new file mode 100644
index 0000000..1294ee9
--- /dev/null
+++ b/man/maptools.Rd
@@ -0,0 +1,25 @@
+\name{maptools}
+\alias{maptools}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Report version information and changes}
+\description{
+ Access version information and changes
+}
+\usage{
+maptools(changes = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{changes}{If TRUE, reports changes, most recent last}
+}
+
+\value{
+ Invisibly returns the change list, with members version and changes
+
+}
+\author{Roger Bivand}
+
+\examples{
+maptools(changes=TRUE)
+}
+\keyword{spatial}
diff --git a/man/nowrapRecenter.Rd b/man/nowrapRecenter.Rd
new file mode 100644
index 0000000..67ef220
--- /dev/null
+++ b/man/nowrapRecenter.Rd
@@ -0,0 +1,54 @@
+\name{nowrapRecenter}
+\alias{nowrapRecenter}
+\alias{nowrapSpatialPolygons}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Break polygons at meridian for recentering}
+\description{
+ When recentering a world map, say to change an "Atlantic" view with longitude range -180 to 180, to a "Pacific" view, with longitude range 0 to 360, polygons crossed by the new offset, here 0/360, need to be clipped into left and right sub.polygons to avoid horizontal scratches across the map. The \code{nowrapSpatialPolygons} function performs this operation using polygon intersection, and \code{nowrapRecenter} recenters the output SpatialPolygons object.
+}
+\usage{
+nowrapRecenter(obj, offset = 0, eps = rep(.Machine$double.eps, 2))
+nowrapSpatialPolygons(obj, offset = 0, eps=rep(.Machine$double.eps, 2))
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{obj}{ A SpatialPolygons object }
+ \item{offset}{ offset from the Greenwich meridian }
+ \item{eps}{vector of two (left and right) fuzz factors to retract the ring from the offset}
+}
+
+\value{
+ A SpatialPolygons object
+}
+
+\author{Roger Bivand}
+
+
+\seealso{\code{\link[sp]{recenter}}, \code{\link[sp]{nowrapSpatialLines}}}
+
+\examples{
+library(gpclib)
+\dontrun{
+library(maps)
+world <- map("world", fill=TRUE, col="transparent", plot=FALSE)
+worldSpP <- map2SpatialPolygons(world, world$names, CRS("+proj=longlat"))
+worldSpPr <- recenter(worldSpP)
+plot(worldSpPr)
+title("Pacific view without polygon splitting")
+worldSpPnr <- nowrapRecenter(worldSpP)
+plot(worldSpPnr)
+title("Pacific view with polygon splitting")
+}
+crds <- matrix(c(-1, 1, 1, -1, 50, 50, 52, 52), ncol=2)
+rcrds <- rbind(crds, crds[1,])
+SR <- SpatialPolygons(list(Polygons(list(Polygon(rcrds)), ID="r1")),
+ proj4string=CRS("+proj=longlat"))
+bbox(SR)
+SRr <- recenter(SR)
+bbox(SRr)
+SRnr <- nowrapRecenter(SR)
+bbox(SRnr)
+}
+
+\keyword{spatial}
+
diff --git a/man/pal2SpatialPolygons.Rd b/man/pal2SpatialPolygons.Rd
new file mode 100644
index 0000000..e813eef
--- /dev/null
+++ b/man/pal2SpatialPolygons.Rd
@@ -0,0 +1,56 @@
+\name{pal2SpatialPolygons}
+\alias{pal2SpatialPolygons}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Making SpatialPolygons objects from RArcInfo input}
+\description{
+ This function is used in making SpatialPolygons objects from RArcInfo input.
+}
+\usage{
+pal2SpatialPolygons(arc, pal, IDs, dropPoly1=TRUE,
+ proj4string=CRS(as.character(NA)))
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{IDs}{Unique character ID values for each output Polygons object; the input IDs can be an integer or character vector with duplicates, where the duplicates will be combined as a single output Polygons object}
+ \item{proj4string}{Object of class \code{"CRS"};
+ holding a valid proj4 string}
+ \item{arc}{Object returned by \code{get.arcdata}}
+ \item{pal}{Object returned by \code{get.paldata}}
+ \item{dropPoly1}{Should the first polygon in the AVC or e00 data be dropped; the first polygon is typically the compound boundary of the whole dataset, and can be detected by looking at the relative lengths of the list components in the second component of pal, which are the numbers of arcs making up the boundary of each polygon}
+}
+
+\value{
+ The functions return a SpatialPolygons object
+}
+
+\author{ Roger Bivand }
+
+\examples{
+nc1 <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], ID="FIPS")
+plot(nc1)
+text(coordinates(nc1), labels=sapply(slot(nc1, "polygons"),
+ function(i) slot(i, "ID")), cex=0.6)
+library(maps)
+ncmap <- map("county", "north carolina", fill=TRUE, col="transparent",
+ plot=FALSE)
+IDs <- sapply(strsplit(ncmap$names, "[,:]"), function(x) x[2])
+nc2 <- map2SpatialPolygons(ncmap, IDs)
+plot(nc2)
+text(coordinates(nc2), labels=sapply(slot(nc2, "polygons"),
+ function(i) slot(i, "ID")), cex=0.6)
+library(RArcInfo)
+td <- tempdir()
+tmpcover <- paste(td, "nc", sep="/")
+if (!file.exists(tmpcover)) e00toavc(system.file("share/co37_d90.e00",
+ package="maptools")[1], tmpcover)
+arc <- get.arcdata(td, "nc")
+pal <- get.paldata(td, "nc")
+pat <- get.tabledata(paste(td, "info", sep="/"), "NC.PAT")
+sapply(pal[[2]], function(x) length(x[[1]]))
+IDs <- paste(pat$ST[-1], pat$CO[-1], sep="")
+nc3 <- pal2SpatialPolygons(arc, pal, IDs=IDs)
+plot(nc3)
+text(coordinates(nc3), labels=sapply(slot(nc3, "polygons"),
+ function(i) slot(i, "ID")), cex=0.6)
+}
+\keyword{spatial}
diff --git a/man/plot.Map.Rd b/man/plot.Map.Rd
new file mode 100644
index 0000000..bbfdf62
--- /dev/null
+++ b/man/plot.Map.Rd
@@ -0,0 +1,58 @@
+\name{plot.Map}
+\alias{plot.Map}
+%\alias{color.ramp}
+
+\title{Plot a Map object (deprecated)}
+\description{
+ This function is deprecated. It is difficult to maintain and there are several alternatives, either by converting Map objects to sp class objects or polylist etc. objects. (The function plots a map object directly from the imported shapefile data).
+}
+\usage{
+\method{plot}{Map}(x, recs, auxvar = NULL, add = FALSE, fg = "gray", ol = "black",
+ prbg = NULL, glyph = 16, color='red', type = "q", nclass = 5, \dots)
+%color.ramp(nclass, color='red', nvec=NULL, type='q')
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{x}{a Map object returned by read.shape()}
+ \item{recs}{a vector with the shapes to plot, if missing defaults to all shapes; if fg is not equal to the length of recs, all fg are set to fg[1]}
+ \item{auxvar}{if the Map has polygon shapes, a variable from which to derive polygon fill colours using the computed class intervals, must be same length as number of shapes}
+ \item{add}{default FALSE, if TRUE add to existing plot}
+ \item{fg}{foreground colour, can be used to pass through point and polygon colours, permitting the built-in class interval calculation to be avoided; if fg is not equal to the length of recs, all fg are set to fg[1]}
+ \item{ol}{line/boundary colour; boundaries may be removed by setting to NA oe "transparent"}
+ \item{prbg}{if not NULL, draw a rectangle around the plot in this colour}
+ \item{glyph}{points plotted as this pch code}
+ \item{color}{base colour for color.ramp(); default "red"}
+ \item{type}{default "q" for quantile classes for color.ramp(), can also be "e" for equal intervals}
+ \item{nclass}{number of classes for class intervals}
+ \item{\dots}{passed through to plotting functions}
+% \item{color}{default "red"}
+% \item{nvec}{data vector to convert to class intervals}
+}
+
+\value{
+ If the \code{auxvar} variable is not used, the function returns NULL, otherwise it returns the list constructed by \code{maptools:::color.ramp()} with components:
+ \item{ramp}{vector of colours}
+ \item{col.class}{vector of classes}
+ \item{breaks}{class intervals given as argument to cut}
+}
+
+\author{Nicholas J. Lewin-Koh, modified by Roger Bivand \email{Roger.Bivand at nhh.no}}
+
+\seealso{\code{\link{read.shape}}, \code{\link{readShapePoly}}, \code{\link{readShapeLines}}, \code{\link{readShapePoints}}, \code{\link{getinfo.shape}}}
+\examples{
+\dontrun{
+x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])
+plot(x)
+nParts <- sapply(x$Shapes, function(x) attr(x, "nPart"))
+table(nParts)
+cols <- c("azure", "blue", "orange")
+fgs <- cols[nParts]
+plot(x, fg=fgs)
+res <- plot(x, auxvar=x$att.data$BIR74)
+str(res)
+res <- plot(x, auxvar=x$att.data$BIR74, type="e")
+str(res)
+}
+}
+\keyword{spatial}
+
diff --git a/man/plot.polylist.Rd b/man/plot.polylist.Rd
new file mode 100644
index 0000000..adda96b
--- /dev/null
+++ b/man/plot.polylist.Rd
@@ -0,0 +1,66 @@
+% Copyright 2001-4 by Roger S. Bivand
+\name{plot.polylist}
+\alias{plotpolys}
+\alias{plot.polylist}
+\alias{leglabs}
+\title{Plot polygons}
+\description{
+A helper function for plotting polygons in a global bounding box, attempts to handle overplotting internally, holes should be coded by coordinates ordered anti-clockwise. Earlier behaviour requires forcefill=TRUE; this is now default, but will cease to be so from next release. Changes caused by some imported shapefiles data leading to erroneously plotting lakes/islands, and R polygon() overplotting internal polygons.
+\code{leglabs} makes character strings from the same break points. The \code{plot.polylist()} function may be used as a generic S3 method. NOTE! \code{plotpolys()} DEPRECATED: use generic plot() for polylist objects function instead.
+}
+\usage{
+\method{plot}{polylist}(x, col, border = par("fg"), add = FALSE, xlim=NULL,
+ ylim=NULL, xlab = "", ylab = "", xpd = NULL, density = NULL, angle = 45,
+ pbg=NULL, forcefill=TRUE, ...)
+leglabs(vec, under="under", over="over", between="-")
+plotpolys(pl, bb, col = NA, border = par("fg"), add = FALSE, xlim=NULL,
+ ylim=NULL, ...)
+}
+
+\arguments{
+ \item{pl, x}{list of polygons of class \code{polylist}}
+ \item{bb}{matrix of polygon bounding boxes - columns are LL(x), LL(y), UR(x), UR(y); note that this argument may be omitted if the polygon list object has an "maplim" attribute, or if both xlim and ylim arguments are given}
+ \item{col}{colurs to use for filling the polygons}
+ \item{border}{the color to draw the border}
+ \item{add}{add to existing plot}
+ \item{xlim, ylim}{numeric of length 2, giving the x and y coordinates ranges}
+ \item{xlab, ylab}{x and y axis labels, default no label}
+ \item{xpd}{(where) should clipping take place?}
+ \item{density}{the density of shading lines, in lines per inch}
+ \item{angle}{the slope of shading lines, given as an angle in degrees (counter-clockwise)}
+ \item{pbg}{colour to be used for hole and background fill, by default NULL (note that par("bg") may be "transparent")}
+ \item{forcefill}{default TRUE \emph{until next release} - fill anyway, if FALSE: believe ring direction as indication of holes/lakes}
+ \item{...}{other arguments passed to plot to set the plot window - not passed to polygon}
+ \item{vec}{vector of break values}
+ \item{under}{character value for under}
+ \item{over}{character value for over}
+ \item{between}{character value for between}
+% \item{y}{numeric vector to be broken into class intervals}
+% \item{rightmost.closed}{as in findInterval()}
+% \item{all.inside}{as in findInterval()}
+}
+\author{Roger Bivand \email{Roger.Bivand at nhh.no}}
+
+\seealso{\code{\link{Map2poly}}, \code{\link{findInterval}}}
+
+\examples{
+try2 <- read.shape(system.file("shapes/columbus.shp", package="maptools")[1])
+mappolys <- Map2poly(try2, as.character(try2$att.data$NEIGNO))
+brks <- round(quantile(try2$att.data$CRIME, probs=seq(0,1,0.2)), digits=2)
+colours <- c("salmon1", "salmon2", "red3", "brown", "black")
+plot(mappolys, col=colours[findInterval(try2$att.data$CRIME, brks,
+ all.inside=TRUE)], forcefill=FALSE)
+legend(x=c(5.8, 7.1), y=c(13, 14.5), legend=leglabs(brks),
+ fill=colours, bty="n")
+invisible(title(main=paste("Columbus OH: residential burglaries and vehicle",
+ "thefts per thousand households, 1980", sep="\n")))
+try3 <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])
+mappolys <- Map2poly(try3, as.character(try3$att.data$FIPSNO))
+cols <- c("pink", "orange", "red")
+np <- sapply(mappolys, function(x) attr(x, "nParts"))
+plot(mappolys, col=cols[np], forcefill=FALSE)
+invisible(title(main="White: one part, orange: two part, red: three part polygons"))
+plot(mappolys, density=c(10, 20, 30)[np], angle=c(-45, 0, 45)[np],
+ axes=FALSE, forcefill=FALSE)
+}
+\keyword{spatial}
diff --git a/man/pointLabel.Rd b/man/pointLabel.Rd
new file mode 100644
index 0000000..97dd541
--- /dev/null
+++ b/man/pointLabel.Rd
@@ -0,0 +1,103 @@
+\name{pointLabel}
+\alias{pointLabel}
+\title{ Label placement for points to avoid overlaps }
+\description{
+ Use optimization routines to find good locations for point labels
+ without overlaps.
+}
+\usage{
+pointLabel(x, y = NULL, labels = seq(along = x), cex = 1,
+ method = c("SANN", "GA"),
+ allowSmallOverlap = FALSE,
+ trace = FALSE,
+ doPlot = TRUE,
+ ...)
+}
+\arguments{
+ \item{x, y}{ as with \code{plot.default}, these provide the x and y coordinates for
+ the point labels. Any reasonable way of defining the coordinates is
+ acceptable. See the function \code{xy.coords} for details. }
+ \item{labels}{ as with \code{text}, a character vector or expression specifying the text to be
+ written. An attempt is made to coerce other language objects
+ (names and calls) to expressions, and vectors and other
+ classed objects to character vectors by \code{as.character}. }
+ \item{cex}{ numeric character expansion factor as with \code{text}. }
+ \item{method}{ the optimization method, either \dQuote{SANN} for simulated
+ annealing (the default) or \dQuote{GA} for a genetic algorithm. }
+ \item{allowSmallOverlap}{ logical; if \code{TRUE}, labels are allowed
+ a small overlap. The overlap allowed is 2\% of the diagonal
+ distance of the plot area.}
+ \item{trace}{ logical; if \code{TRUE}, status updates are given as the optimization algorithms
+ progress.}
+ \item{doPlot}{ logical; if \code{TRUE}, the labels are plotted on the
+ existing graph with \code{text}.}
+ \item{\ldots}{ arguments passed along to \code{text} to specify
+ labeling parameters such as \code{col}. }
+
+}
+\details{
+
+ Eight positions are candidates for label placement, either
+ horizontally, vertically, or diagonally offset from the points. The
+ default position for labels is the top right diagonal relative to the
+ point (considered the preferred label position).
+
+ With the default settings, simulating annealing solves faster than the
+ genetic algorithm. It is an open question as to which settles into a
+ global optimum the best (both algorithms have parameters that may be
+ tweaked).
+
+ The label positioning problem is NP-hard (nondeterministic
+ polynomial-time hard). Placement becomes difficult and slows
+ considerably with large numbers of points. This function places all
+ labels, whether overlaps occur or not. Some placement algorithms
+ remove labels that overlap.
+
+ Note that only \code{cex} is used to calculate string width and
+ height (using \code{strwidth} and \code{strheight}), so passing a
+ different font may corrupt the label dimensions. You could get around
+ this by adjusting the font parameters with \code{par} prior to running
+ this function.
+
+}
+\value{
+ An \code{xy} list giving the \code{x} and \code{y} positions of the
+ label as would be placed by \code{text(xy, labels)}.
+}
+\references{
+
+\url{http://en.wikipedia.org/wiki/Automatic_label_placement}
+
+\url{http://i11www.iti.uni-karlsruhe.de/map-labeling/bibliography/}
+
+\url{http://www.eecs.harvard.edu/~shieber/Projects/Carto/carto.html}
+
+\url{http://www.szoraster.com/Cartography/PracticalExperience.htm}
+
+The genetic algorithm code was adapted from the python code at
+
+\url{http://meta.wikimedia.org/wiki/Map_generator}.
+
+The simulated annealing code follows the algorithm and guidelines in:
+
+Jon Christensen, Joe Marks, and Stuart Shieber. Placing text labels on
+maps and diagrams. In Paul Heckbert, editor, Graphics Gems IV, pages
+497-504. Academic Press, Boston, MA, 1994.
+\url{http://www.eecs.harvard.edu/~shieber/Biblio/Papers/jc.label.pdf}
+
+}
+\author{ Tom Short, EPRI, \email{tshort at epri.com} }
+\seealso{ \code{\link{text}}, \code{\link[plotrix]{thigmophobe.labels}}
+ in package \pkg{plotrix} }
+\examples{
+n <- 50
+x <- rnorm(n)*10
+y <- rnorm(n)*10
+plot(x, y, col = "red", pch = 20)
+pointLabel(x, y, as.character(round(x,5)), offset = 0, cex = .7)
+
+plot(x, y, col = "red", pch = 20)
+pointLabel(x, y, expression(over(alpha, beta[123])), offset = 0, cex = .8)
+
+}
+\keyword{aplot}
diff --git a/man/ppp.Rd b/man/ppp.Rd
new file mode 100644
index 0000000..68cd8b0
--- /dev/null
+++ b/man/ppp.Rd
@@ -0,0 +1,12 @@
+\name{ppp-class}
+\docType{class}
+\alias{ppp-class}
+\alias{owin-class}
+\alias{im-class}
+\alias{psp-class}
+
+\title{Virtual class "ppp" }
+\description{ Virtual S4 class definition for S3 classes in the spatstat package to allow S4-style coercion to these classes}
+\section{Objects from the Class}{A virtual Class: No objects may be created from it.}
+\author{ Edzer J. Pebesma }
+\keyword{classes}
diff --git a/man/read.shape.Rd b/man/read.shape.Rd
new file mode 100644
index 0000000..214dc08
--- /dev/null
+++ b/man/read.shape.Rd
@@ -0,0 +1,43 @@
+\name{read.shape}
+\alias{read.shape}
+\alias{getinfo.shape}
+\alias{print.shapehead}
+
+\title{Read shapefile into Map object}
+\description{
+ Read shapefile into Map object; the file should be given including its ".shp" extension, and the function will reconstruct the names of the database (dbf) file and the index (shx) file from these.
+}
+\usage{
+read.shape(filen, dbf.data = TRUE, verbose=TRUE, repair=FALSE)
+getinfo.shape(filen)
+\method{print}{shapehead}(x, ...)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{filen}{name of file with *.shp extension}
+ \item{dbf.data}{read DBF data together with shapes, default TRUE}
+ \item{verbose}{default TRUE --- report type of shapefile and number of shapes}
+ \item{repair}{default FALSE: some shapefiles provided by Geolytics Inc. have values of object sizes stored in the *.shx index file that are eight bytes too large, leading the function to try to read past the end of file. If repair=TRUE, an attempt is made to repair the internal values, permitting such files to be read.}
+ \item{x}{a shapehead list as returned by getinfo.shape}
+ \item{...}{other arguments passed to print}
+}
+\details{
+ The function calls code from shapelib to read shapefiles, a file format used by ESRI GIS software among others
+}
+\value{
+read.shape() returns either a list of shapes of class ShapeList, or if dbf.data = TRUE a Map object with:
+ \item{Shapes}{a list of shapes of class ShapeList; both the individual shapes and the list have attributes}
+ \item{att.data}{a data frame of data from the associated DBF file; note that the field names are adjusted to use in R using \code{make.names()}, and so will permit the underscore character from R release 1.9.0.}
+}
+\references{\url{http://shapelib.maptools.org/}}
+\author{Nicholas J. Lewin-Koh, modified by Roger Bivand \email{Roger.Bivand at nhh.no}; shapelib by Frank Warmerdam}
+
+\seealso{\code{\link{plot.Map}}, \code{\link[foreign]{read.dbf}}}
+\examples{
+x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])
+length(x$Shapes)
+unlist(lapply(x$att.data, class))
+str(getinfo.shape(system.file("shapes/fylk-val.shp", package="maptools")[1]))
+}
+\keyword{spatial}
+
diff --git a/man/readGPS.Rd b/man/readGPS.Rd
new file mode 100644
index 0000000..0760c60
--- /dev/null
+++ b/man/readGPS.Rd
@@ -0,0 +1,51 @@
+\name{readGPS}
+\alias{readGPS}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{GPSbabel read interface}
+\description{
+ The function reads a data frame from an attached GPS using the external program gpsbabel. The columns of the data frame need to be identified by hand because different GPS order NMEA data in different ways, and the columns should be converted to the correct classes by hand. Once the specifics of a particular GPS are identified, and ways of cleaning erroneous locations are found, the conversion of the output data frame into a usable one may be automated.
+}
+\usage{
+readGPS(i = "garmin", f = "usb:", type="w", invisible=TRUE, ...)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{i}{INTYPE: a supported file type, default "garmin"}
+ \item{f}{INFILE: the appropriate device interface, default "usb:", on Windows for serial interfaces commonly "com4:" or similar}
+ \item{type}{"w" waypoints, or "t" track, or others provided in gpsbabel}
+ \item{invisible}{Under Windows, do not open an extra window}
+ \item{...}{arguments passed through to \code{read.table}}
+}
+\details{
+The function just wraps: gpsbabel -i INTYPE -f INFILE -o tabsep -F - in system(), and reads the returned character vector of lines into a data frame. On some systems, INFILE may not be readable by ordinary users without extra configuration. The gpsbabel program must be present and on the user's PATH for the function to work. Typically, for a given GPS, the user will have to experiment first to find a set of data-cleaning tricks that work, but from then on they should be repeatable.
+}
+\value{
+ A data frame of waypoint values
+}
+\references{\url{http://www.gpsbabel.org}}
+\author{Patrick Giraudoux and Roger Bivand}
+
+\examples{
+\dontrun{
+b1 <- readGPS(f="usb:")
+str(b1)
+b2 <- b1[1:172,]
+wp0 <- b2[,c(2,3,4,8,9,19)]
+str(wp0)
+wp0$long <- wp0$V9
+wp0$lat <- as.numeric(as.character(wp0$V8))
+wp0$id <- as.character(wp0$V2)
+wp0$alt <- as.numeric(substring(as.character(wp0$V19), 1,
+ (nchar(as.character(wp0$V19))-1)))
+wp0$time <- as.POSIXct(strptime(paste(as.character(wp0$V3),
+ as.character(wp0$V4)), format="\%d-\%b-\%y \%H:\%M:\%S"))
+str(wp0)
+wp1 <- wp0[,-(1:6)]
+str(wp1)
+summary(wp1)
+}
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{spatial}
+
diff --git a/man/readShapeLines.Rd b/man/readShapeLines.Rd
new file mode 100644
index 0000000..f3fb889
--- /dev/null
+++ b/man/readShapeLines.Rd
@@ -0,0 +1,52 @@
+\name{readShapeLines}
+\alias{readShapeLines}
+\alias{writeLinesShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Read arc shape files into SpatialLinesDataFrame objects}
+\description{
+ The \code{readShapeLines} function reads data from an arc/line shapefile into a \code{SpatialLinesDataFrame} object; the shapefile may be of type polygon, but for just plotting for example coastlines, a SpatialLines object is sufficient. The \code{writeLinesShape} function writes data from a \code{SpatialLinesDataFrame} object to a shapefile.
+}
+\usage{
+readShapeLines(fn, proj4string=CRS(as.character(NA)), verbose=FALSE,
+ repair=FALSE)
+writeLinesShape(x, fn, factor2char = TRUE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{fn}{shapefile layer name, when writing omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{proj4string}{Object of class \code{CRS}; holding a valid proj4 string}
+ \item{verbose}{default TRUE - report type of shapefile and number of shapes}
+ \item{repair}{default FALSE: some shapefiles provided by Geolytics Inc. have values of object sizes stored in the *.shx index file that are eight bytes too large, leading the function to try to read past the end of file. If repair=TRUE, an attempt is made to repair the internal values, permitting such files to be read.}
+ \item{x}{a \code{SpatialLinesDataFrame} object}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+\details{The shpID values of the shapefile will be used as \code{Lines} ID values; when writing shapefiles, the object data slot rownames are added to the DBF file as column SL\_ID.}
+
+\value{
+ a SpatialLinesDataFrame object
+}
+
+\author{ Roger Bivand }
+
+
+\examples{
+xx <- readShapeLines(system.file("shapes/fylk-val.shp", package="maptools")[1],
+ proj4string=CRS("+proj=utm +zone=33 +datum=WGS84"))
+plot(xx, col="blue")
+summary(xx)
+xxx <- xx[xx$LENGTH > 30000,]
+plot(xxx, col="red", add=TRUE)
+tmpfl <- paste(tempdir(), "xxline", sep="/")
+writeLinesShape(xxx, tmpfl)
+getinfo.shape(paste(tmpfl, ".shp", sep=""))
+axx <- readShapeLines(tmpfl, proj4string=CRS("+proj=utm +zone=33 +datum=WGS84"))
+plot(xxx, col="black", lwd=4)
+plot(axx, col="yellow", lwd=1, add=TRUE)
+unlink(paste(tmpfl, ".*", sep=""))
+xx <- readShapeLines(system.file("shapes/sids.shp", package="maptools")[1],
+ proj4string=CRS("+proj=longlat +datum=NAD27"))
+plot(xx, col="blue")
+}
+\keyword{spatial}
+
diff --git a/man/readShapePoints.Rd b/man/readShapePoints.Rd
new file mode 100644
index 0000000..ec35c1e
--- /dev/null
+++ b/man/readShapePoints.Rd
@@ -0,0 +1,49 @@
+\name{readShapePoints}
+\alias{readShapePoints}
+\alias{writePointsShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Read points shape files into SpatialPointsDataFrame objects}
+\description{
+ The \code{readShapePoints} reads data from a points shapefile into a \code{SpatialPointsDataFrame} object. The \code{writePointsShape} function writes data from a \code{SpatialPointsDataFrame} object to a shapefile. Both reading and writing can be carried out for 2D and 3D point coordinates.
+}
+\usage{
+readShapePoints(fn, proj4string = CRS(as.character(NA)), verbose = FALSE,
+ repair=FALSE)
+writePointsShape(x, fn, factor2char = TRUE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{fn}{shapefile layer name, when writing omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{proj4string}{Object of class \code{CRS}; holding a valid proj4 string}
+ \item{verbose}{default TRUE - report type of shapefile and number of shapes}
+ \item{repair}{default FALSE: some shapefiles provided by Geolytics Inc. have values of object sizes stored in the *.shx index file that are eight bytes too large, leading the function to try to read past the end of file. If repair=TRUE, an attempt is made to repair the internal values, permitting such files to be read.}
+ \item{x}{a \code{SpatialPointsDataFrame} object}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+
+\value{
+ a SpatialPointsDataFrame object
+}
+
+\author{ Roger Bivand }
+
+\examples{
+library(maptools)
+xx <- readShapePoints(system.file("shapes/baltim.shp", package="maptools")[1])
+plot(xx)
+summary(xx)
+xxx <- xx[xx$PRICE < 40,]
+tmpfl <- paste(tempdir(), "xxpts", sep="/")
+writePointsShape(xxx, tmpfl)
+getinfo.shape(paste(tmpfl, ".shp", sep=""))
+axx <- readShapePoints(tmpfl)
+plot(axx, col="red", add=TRUE)
+unlink(paste(tmpfl, ".*", sep=""))
+xx <- readShapePoints(system.file("shapes/pointZ.shp", package="maptools")[1])
+dimensions(xx)
+plot(xx)
+summary(xx)
+}
+\keyword{spatial}
+
diff --git a/man/readShapePoly.Rd b/man/readShapePoly.Rd
new file mode 100644
index 0000000..63e3516
--- /dev/null
+++ b/man/readShapePoly.Rd
@@ -0,0 +1,56 @@
+\name{readShapePoly}
+\alias{readShapePoly}
+\alias{writePolyShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Read polygon shape files into SpatialPolygonsDataFrame objects}
+\description{
+ The \code{readShapePoly} reads data from a polygon shapefile into a \code{SpatialPolygonsDataFrame} object. The \code{writePolyShape} function writes data from a \code{SpatialPolygonsDataFrame} object to a shapefile.
+}
+\usage{
+readShapePoly(fn, IDvar=NULL, proj4string=CRS(as.character(NA)),
+ verbose=FALSE, repair=FALSE, force_ring=FALSE, delete_null_obj=FALSE,
+ retrieve_ABS_null=FALSE)
+writePolyShape(x, fn, factor2char = TRUE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{fn}{shapefile layer name, when writing omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{IDvar}{a character string: the name of a column in the shapefile DBF containing the ID values of the shapes - the values will be converted to a character vector}
+ \item{proj4string}{Object of class \code{CRS}; holding a valid proj4 string}
+ \item{verbose}{default TRUE - report type of shapefile and number of shapes}
+ \item{repair}{default FALSE: some shapefiles provided by Geolytics Inc. have values of object sizes stored in the *.shx index file that are eight bytes too large, leading the function to try to read past the end of file. If repair=TRUE, an attempt is made to repair the internal values, permitting such files to be read.}
+ \item{force_ring}{if TRUE, close unclosed input rings}
+ \item{delete_null_obj}{if TRUE, null geometries inserted by ABS will be removed together with their data.frame rows}
+ \item{retrieve_ABS_null}{default FALSE, if TRUE and delete\_null\_obj also
+TRUE, the function will return a data frame containing the data from any
+null geometries inserted by ABS}
+ \item{x}{a \code{SpatialPolygonsDataFrame} object}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+\details{If no IDvar argument is given, the shpID values of the shapefile will be used as \code{Polygons} ID values; when writing shapefiles, the object data slot rownames are added to the DBF file as column SP\_ID.}
+\value{
+ a SpatialPolygonsDataFrame object
+}
+
+\author{ Roger Bivand }
+
+\examples{
+library(maptools)
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+plot(xx, border="blue", axes=TRUE, las=1)
+text(coordinates(xx), labels=sapply(slot(xx, "polygons"),
+ function(i) slot(i, "ID")), cex=0.6)
+as(xx, "data.frame")[1:5, 1:6]
+xxx <- xx[xx$SID74 < 2,]
+plot(xxx, border="red", add=TRUE)
+tmpfl <- paste(tempdir(), "xxpoly", sep="/")
+writePolyShape(xxx, tmpfl)
+getinfo.shape(paste(tmpfl, ".shp", sep=""))
+axx <- readShapePoly(tmpfl, proj4string=CRS("+proj=longlat +ellps=clrk66"))
+plot(xxx, border="black", lwd=4)
+plot(axx, border="yellow", lwd=1, add=TRUE)
+unlink(paste(tmpfl, ".*", sep=""))
+}
+\keyword{spatial}
diff --git a/man/readShapeSpatial.Rd b/man/readShapeSpatial.Rd
new file mode 100644
index 0000000..1c5b029
--- /dev/null
+++ b/man/readShapeSpatial.Rd
@@ -0,0 +1,65 @@
+\name{readShapeSpatial}
+\alias{readShapeSpatial}
+\alias{writeSpatialShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Read shape files into Spatial*DataFrame objects}
+\description{
+ The \code{readShapeSpatial} reads data from a shapefile into a \code{Spatial*DataFrame} object. The \code{writeSpatialShape} function writes data from a \code{Spatial*DataFrame} object to a shapefile.
+}
+\usage{
+readShapeSpatial(fn, proj4string=CRS(as.character(NA)),
+ verbose=FALSE, repair=FALSE, IDvar=NULL, force_ring=FALSE,
+ delete_null_obj=FALSE, retrieve_ABS_null=FALSE)
+writeSpatialShape(x, fn, factor2char = TRUE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{fn}{shapefile layer name, when writing omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{proj4string}{Object of class \code{CRS}; holding a valid proj4 string}
+ \item{verbose}{default TRUE - report type of shapefile and number of shapes}
+ \item{repair}{default FALSE: some shapefiles provided by Geolytics Inc. have values of object sizes stored in the *.shx index file that are eight bytes too large, leading the function to try to read past the end of file. If repair=TRUE, an attempt is made to repair the internal values, permitting such files to be read.}
+ \item{IDvar}{a character string: the name of a column in the shapefile DBF containing the ID values of the shapes - the values will be converted to a character vector (Polygons only)}
+ \item{force_ring}{if TRUE, close unclosed input rings (Polygons only)}
+ \item{delete_null_obj}{if TRUE, null geometries inserted by ABS will be removed together with their data.frame rows (Polygons only)}
+ \item{retrieve_ABS_null}{default FALSE, if TRUE and delete\_null\_obj also
+TRUE, the function will return a data frame containing the data from any
+null geometries inserted by ABS (Polygons only)}
+ \item{x}{a vector data \code{Spatial*DataFrame} object}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+\details{If no IDvar argument is given, the shpID values of the shapefile will be used as \code{Polygons} ID values; when writing shapefiles, the object data slot rownames are added to the DBF file as column SP\_ID.}
+\value{
+ a Spatial*DataFrame object of a class corresponding to the input shapefile
+}
+
+\author{ Roger Bivand }
+
+\examples{
+library(maptools)
+xx <- readShapeSpatial(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+summary(xx)
+xxx <- xx[xx$SID74 < 2,]
+tmpfl <- paste(tempdir(), "xxpoly", sep="/")
+writeSpatialShape(xxx, tmpfl)
+getinfo.shape(paste(tmpfl, ".shp", sep=""))
+unlink(paste(tmpfl, ".*", sep=""))
+xx <- readShapeSpatial(system.file("shapes/fylk-val.shp",
+ package="maptools")[1], proj4string=CRS("+proj=utm +zone=33 +datum=WGS84"))
+summary(xx)
+xxx <- xx[xx$LENGTH > 30000,]
+plot(xxx, col="red", add=TRUE)
+tmpfl <- paste(tempdir(), "xxline", sep="/")
+writeSpatialShape(xxx, tmpfl)
+getinfo.shape(paste(tmpfl, ".shp", sep=""))
+unlink(paste(tmpfl, ".*", sep=""))
+xx <- readShapeSpatial(system.file("shapes/baltim.shp", package="maptools")[1])
+summary(xx)
+xxx <- xx[xx$PRICE < 40,]
+tmpfl <- paste(tempdir(), "xxpts", sep="/")
+writeSpatialShape(xxx, tmpfl)
+getinfo.shape(paste(tmpfl, ".shp", sep=""))
+unlink(paste(tmpfl, ".*", sep=""))
+}
+\keyword{spatial}
diff --git a/man/readSplus.Rd b/man/readSplus.Rd
new file mode 100644
index 0000000..e5ac081
--- /dev/null
+++ b/man/readSplus.Rd
@@ -0,0 +1,37 @@
+\name{readSplus}
+\alias{readSplus}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Read exported WinBUGS maps}
+\description{
+ The function permits an exported WinBUGS map to be read into an \pkg{sp} package class \code{SpatialPolygons} object.
+}
+\usage{
+readSplus(file, proj4string = CRS(as.character(NA)))
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{file}{name of file}
+ \item{proj4string}{Object of class '"CRS"'; holding a valid proj4 string}
+}
+
+\value{
+ \code{readSplus} returns a SpatialPolygons object
+}
+\references{\url{http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/geobugs12manual.pdf}}
+\author{Virgilio Gomez Rubio <Virgilio.Gomez at uclm.es>}
+\note{In the example, taken from the GeoBUGS manual, the smaller part of area1 has a counter-clockwise ring direction in the data, while other rings are clockwise. This implies that it is a hole, and does not get filled. Errant holes may be filled using \code{\link{checkPolygonsHoles}}. The region labels are stored in the \code{ID} slots of the \code{Polygons} objects.}
+\seealso{\code{\link{map2SpatialPolygons}}}
+\examples{
+geobugs <- readSplus(system.file("share/Splus.map", package="maptools"))
+plot(geobugs, axes=TRUE, col=1:3)
+sapply(slot(geobugs, "polygons"), slot, "ID")
+pls <- slot(geobugs, "polygons")
+sapply(pls, function(i) sapply(slot(i, "Polygons"), slot, "hole"))
+pls1 <- lapply(pls, checkPolygonsHoles)
+sapply(pls1, function(i) sapply(slot(i, "Polygons"), slot, "hole"))
+plot(SpatialPolygons(pls1), axes=TRUE, col=1:3)
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{spatial}
+
diff --git a/man/sp2Mondrian.Rd b/man/sp2Mondrian.Rd
new file mode 100644
index 0000000..b00479e
--- /dev/null
+++ b/man/sp2Mondrian.Rd
@@ -0,0 +1,33 @@
+\name{sp2Mondrian}
+\alias{sp2Mondrian}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{write map data for Mondrian}
+\description{
+ The function outputs a SpatialPolygonsDataFrame object to be used by Mondrian
+}
+\usage{
+sp2Mondrian(SP, file, new_format=TRUE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{SP}{a SpatialPolygonsDataFrame object}
+ \item{file}{file where output is written}
+ \item{new_format}{default TRUE, creates a text data file and a separate map file; the old format put both data sets in a single file - the map file is named by inserting "MAP\_" into the file= argument after the rightmost directory separator (if any)}
+}
+
+
+\references{\url{http://rosuda.org/Mondrian/}}
+\author{Patrick Hausmann and Roger Bivand}
+\note{
+ At this release, the function writes out a text file with both data and polygon(s) identified as belonging to each row of data.
+}
+
+\examples{
+\dontrun{
+xx <- readShapePoly(system.file("shapes/columbus.shp", package="maptools")[1])
+sp2Mondrian(xx, file="columbus1.txt")
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1])
+sp2Mondrian(xx, file="sids1.txt")
+}
+}
+\keyword{spatial}
diff --git a/man/sp2WB.Rd b/man/sp2WB.Rd
new file mode 100644
index 0000000..b3831ea
--- /dev/null
+++ b/man/sp2WB.Rd
@@ -0,0 +1,41 @@
+\encoding{latin1}
+\name{sp2WB}
+\alias{sp2WB}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Export SpatialPolygons object as S-Plus map for WinBUGS}
+\description{
+ The function exports an sp SpatialPolygons object into a S-Plus map
+format to be import by WinBUGS.
+}
+\usage{
+sp2WB(map, filename, Xscale = 1, Yscale = Xscale, plotorder = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{map}{a SpatialPolygons object}
+ \item{filename}{file where output is written}
+ \item{Xscale, Yscale}{scales to be written in the output file}
+ \item{plotorder}{default=FALSE, if TRUE, export polygons in plotting order}
+}
+
+\references{\url{http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/geobugs12manual.pdf}}
+\author{Virgilio G�mez Rubio, partly derived from earlier code by Thomas Jagger}
+
+
+\examples{
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+plot(xx, border="blue", axes=TRUE, las=1)
+tf <- tempfile()
+sp2WB(as(xx, "SpatialPolygons"), filename=tf)
+xxx <- readSplus(tf, proj4string=CRS("+proj=longlat +ellps=clrk66"))
+all.equal(xxx, as(xx, "SpatialPolygons"), tolerance=.Machine$double.eps^(1/4),
+ check.attributes=FALSE)
+\dontrun{
+x <- readAsciiGrid(system.file("grids/test.ag", package="maptools")[1])
+xp <- as(x, "SpatialPixelsDataFrame")
+pp <- as.SpatialPolygons.SpatialPixels(xp)
+sp2WB(pp, filename="test.map")
+}
+}
+\keyword{spatial}
diff --git a/man/sp2tmap.Rd b/man/sp2tmap.Rd
new file mode 100644
index 0000000..3a6adee
--- /dev/null
+++ b/man/sp2tmap.Rd
@@ -0,0 +1,39 @@
+\name{sp2tmap}
+\alias{sp2tmap}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Convert SpatialPolygons object for Stata tmap command}
+\description{
+ The function converts a SpatialPolygons object for use with the Stata tmap command, by creating a data frame with the required columns.
+}
+\usage{
+sp2tmap(SP)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{SP}{a SpatialPolygons object}
+}
+
+\value{
+ a data frame with three columns:
+ \item{\_ID}{an integer vector of polygon identifiers in numeric order}
+ \item{\_X}{numeric x coordinate}
+ \item{\_Y}{numeric y coordinate}
+ and an \code{ID_n} attribute with the named polygon identifiers
+}
+\references{\url{http://www.stata.com/search.cgi?query=tmap}}
+\author{Roger Bivand}
+\seealso{\code{\link[foreign]{write.dta}}}
+\examples{
+\dontrun{
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+plot(xx, border="blue", axes=TRUE, las=1)
+tmapdf <- sp2tmap(as(xx, "SpatialPolygons"))
+write.dta(tmapdf, file="NCmap.dta", version=7)
+NCdf <- as(xx, "data.frame")
+NCdf$ID_n <- attr(tmapdf, "ID_names")
+write.dta(NCdf, file="NC.dta", version=7)
+}
+}
+\keyword{spatial}
+
diff --git a/man/spCbind-methods.Rd b/man/spCbind-methods.Rd
new file mode 100644
index 0000000..00eec66
--- /dev/null
+++ b/man/spCbind-methods.Rd
@@ -0,0 +1,48 @@
+\name{spCbind-methods}
+\docType{methods}
+\alias{spCbind-methods}
+\alias{spCbind,SpatialPointsDataFrame,data.frame-method}
+\alias{spCbind,SpatialPointsDataFrame,vector-method}
+\alias{spCbind,SpatialLinesDataFrame,data.frame-method}
+\alias{spCbind,SpatialLinesDataFrame,vector-method}
+\alias{spCbind,SpatialPolygonsDataFrame,data.frame-method}
+\alias{spCbind,SpatialPolygonsDataFrame,vector-method}
+\title{cbind for spatial objects}
+\alias{spCbind}
+\description{
+ \code{spCbind} provides cbind-like methods for Spatial*DataFrame objects in addition to the \code{$}, \code{[<-} and \code{[[<-} methods already available.
+}
+\section{Methods}{
+\describe{
+
+\item{obj = "SpatialPointsDataFrame", x = "data.frame"}{cbind a data frame to the data slot of a SpatialPointsDataFrame object}
+
+\item{obj = "SpatialPointsDataFrame", x = "vector"}{cbind a vector to the data slot of a SpatialPointsDataFrame object}
+
+\item{obj = "SpatialLinesDataFrame", x = "data.frame"}{cbind a data frame to the data slot of a SpatialLinesDataFrame object; the data frame argument must have row names set to the Lines ID values, and should be re-ordered first by matching against a shared key column}
+
+\item{obj = "SpatialLinesDataFrame", x = "vector"}{cbind a vector to the data slot of a SpatialLinesDataFrame object}
+
+\item{obj = "SpatialPolygonsDataFrame", x = "data.frame"}{cbind a data frame to the data slot of a SpatialPolygonsDataFrame object; the data frame argument must have row names set to the Polygons ID values, and should be re-ordered first by matching against a shared key column}
+
+\item{obj = "SpatialPolygonsDataFrame", x = "vector"}{cbind a vector to the data slot of a SpatialPolygonsDataFrame object}
+}}
+
+\author{Roger Bivand}
+
+\seealso{\code{\link{spChFIDs-methods}}, \code{\link{spRbind-methods}}}
+
+\examples{
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+xtra <- read.dbf(system.file("share/nc_xtra.dbf", package="maptools")[1])
+o <- match(xx$CNTY_ID, xtra$CNTY_ID)
+xtra1 <- xtra[o,]
+row.names(xtra1) <- xx$FIPSNO
+xx1 <- spCbind(xx, xtra1)
+names(xx1)
+identical(xx1$CNTY_ID, xx1$CNTY_ID.1)
+}
+
+\keyword{methods}
+\keyword{spatial}
diff --git a/man/spChFIDs-methods.Rd b/man/spChFIDs-methods.Rd
new file mode 100644
index 0000000..de2ca83
--- /dev/null
+++ b/man/spChFIDs-methods.Rd
@@ -0,0 +1,39 @@
+\name{spChFIDs-methods}
+\docType{methods}
+\alias{spChFIDs-methods}
+\alias{spChFIDs,SpatialLines,character-method}
+\alias{spChFIDs,SpatialLinesDataFrame,character-method}
+\alias{spChFIDs,SpatialPolygons,character-method}
+\alias{spChFIDs,SpatialPolygonsDataFrame,character-method}
+\title{change feature IDs in spatial objects}
+\alias{spChFIDs}
+\description{
+ When the feature IDs need to be changed in SpatialLines* or SpatialPolygons* objects, these methods may be used. The new IDs should be a character vector of unique IDs of the correct length.
+}
+\section{Methods}{
+\describe{
+
+\item{obj = "SpatialLines", x = "character"}{replace IDs in a SpatialLines object}
+
+\item{obj = "SpatialLinesDataFrame", x = "character"}{replace IDs in a SpatialLinesDataFrame object}
+
+\item{obj = "SpatialPolygons", x = "character"}{replace IDs in a SpatialPolygons object}
+
+\item{obj = "SpatialPolygonsDataFrame", x = "character"}{replace IDs in a SpatialPolygonsDataFrame object}
+}}
+
+\note{It is usually sensible to keep a copy of the original feature IDs in the object, but this should be done by the user.}
+
+\author{Roger Bivand}
+
+\seealso{\code{\link{spCbind-methods}}, \code{\link{spRbind-methods}}}
+
+\examples{
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+row.names(as(xx, "data.frame"))
+xx1 <- spChFIDs(xx, as.character(xx$CNTY_ID))
+row.names(as(xx1, "data.frame"))
+}
+\keyword{methods}
+\keyword{spatial}
diff --git a/man/spRbind-methods.Rd b/man/spRbind-methods.Rd
new file mode 100644
index 0000000..40e22ef
--- /dev/null
+++ b/man/spRbind-methods.Rd
@@ -0,0 +1,48 @@
+\name{spRbind-methods}
+\docType{methods}
+\alias{spRbind-methods}
+\alias{spRbind,SpatialPoints,SpatialPoints-method}
+\alias{spRbind,SpatialPointsDataFrame,SpatialPointsDataFrame-method}
+\alias{spRbind,SpatialLines,SpatialLines-method}
+\alias{spRbind,SpatialLinesDataFrame,SpatialLinesDataFrame-method}
+\alias{spRbind,SpatialPolygons,SpatialPolygons-method}
+\alias{spRbind,SpatialPolygonsDataFrame,SpatialPolygonsDataFrame-method}
+\alias{spRbind}
+\title{rbind for spatial objects}
+\description{
+ \code{spRbind} provides rbind-like methods for Spatial*DataFrame objects
+}
+\section{Methods}{
+\describe{
+
+\item{obj = "SpatialPoints", x = "SpatialPoints"}{rbind two SpatialPoints objects}
+
+\item{obj = "SpatialPointsDataFrame", x = "SpatialPointsDataFrame"}{rbind two SpatialPointsDataFrame objects}
+
+\item{obj = "SpatialLines", x = "SpatialLines"}{rbind two SpatialLines objects}
+
+\item{obj = "SpatialLinesDataFrame", x = "SpatialLinesDataFrame"}{rbind two SpatialLinesDataFrame objects}
+
+\item{obj = "SpatialPolygons", x = "SpatialPolygons"}{rbind two SpatialPolygons objects}
+
+\item{obj = "SpatialPolygonsDataFrame", x = "SpatialPolygonsDataFrame"}{rbind two SpatialPolygonsDataFrame objects}
+}}
+
+\author{Roger Bivand}
+
+\seealso{\code{\link{spChFIDs-methods}}, \code{\link{spCbind-methods}}}
+
+\examples{
+xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
+summary(xx)
+xx$FIPSNO
+xx1 <- xx[xx$CNTY_ID < 1982,]
+xx2 <- xx[xx$CNTY_ID >= 1982,]
+xx3 <- spRbind(xx2, xx1)
+summary(xx3)
+xx3$FIPSNO
+}
+
+\keyword{methods}
+\keyword{spatial}
diff --git a/man/subset.polylist.Rd b/man/subset.polylist.Rd
new file mode 100644
index 0000000..6982bee
--- /dev/null
+++ b/man/subset.polylist.Rd
@@ -0,0 +1,33 @@
+% Copyright 2003 by Roger S. Bivand
+\name{subset.polylist}
+\alias{subset.polylist}
+\title{Subset polygon list objects}
+\description{
+ The function subsets a polygon list object, also subsetting region ID attributes and also map limits if required.
+}
+\usage{
+\method{subset}{polylist}(x, subset, fit.bbox = TRUE, ...)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{x}{a polylist object}
+ \item{subset}{a logical vector valued TRUE if the element is to be retained}
+ \item{fit.bbox}{if TRUE (default) modifies the maplim attribute to bound the subset}
+ \item{...}{other arguments passed through}
+}
+
+\value{
+ returns a polylist object, lists of polygon boundary coordinates (divided by NA where the polygon object is represented by more than one polygon);
+}
+
+\author{Roger Bivand \email{Roger.Bivand at nhh.no}}
+
+\examples{
+nc <- read.shape(system.file("shapes/sids.shp", package = "maptools")[1])
+mappolys <- Map2poly(nc, as.character(nc$att.data$FIPSNO))
+submap <- subset(mappolys, nc$att.data$SID74 > 0)
+plot(mappolys, col="orange")
+plot(submap, add=TRUE, col="lightpink", forcefill=TRUE)
+}
+\keyword{spatial}
+
diff --git a/man/sun-methods.Rd b/man/sun-methods.Rd
new file mode 100644
index 0000000..e643134
--- /dev/null
+++ b/man/sun-methods.Rd
@@ -0,0 +1,170 @@
+\name{sun-methods}
+\docType{methods}
+
+\alias{crepuscule}
+\alias{sunriset}
+\alias{solarnoon}
+\alias{solarpos}
+
+\alias{crepuscule-methods}
+\alias{crepuscule,SpatialPoints,POSIXct-method}
+\alias{crepuscule,matrix,POSIXct-method}
+\alias{solarnoon-methods}
+\alias{solarnoon,SpatialPoints,POSIXct-method}
+\alias{solarnoon,matrix,POSIXct-method}
+\alias{solarpos-methods}
+\alias{solarpos,SpatialPoints,POSIXct-method}
+\alias{solarpos,matrix,POSIXct-method}
+\alias{sunriset-methods}
+\alias{sunriset,SpatialPoints,POSIXct-method}
+\alias{sunriset,matrix,POSIXct-method}
+
+
+\title{Methods for sun ephemerides calculations}
+
+
+\description{Functions for calculating sunrise, sunset, and times of
+ dawn and dusk, with flexibility for the various formal definitions.
+ They use algorithms provided by the National Oceanic & Atmospheric
+ Administration (NOAA).}
+
+
+\usage{
+
+\S4method{crepuscule}{SpatialPoints,POSIXct}(crds, dateTime, solarDep, direction=c("dawn", "dusk"),
+ POSIXct.out=FALSE)
+\S4method{crepuscule}{matrix,POSIXct}(crds, dateTime,
+ proj4string=CRS("+proj=longlat +datum=WGS84"), solarDep,
+ direction=c("dawn", "dusk"), POSIXct.out=FALSE)
+\S4method{sunriset}{SpatialPoints,POSIXct}(crds, dateTime, direction=c("sunrise", "sunset"),
+ POSIXct.out=FALSE)
+\S4method{sunriset}{matrix,POSIXct}(crds, dateTime,
+ proj4string=CRS("+proj=longlat +datum=WGS84"),
+ direction=c("sunrise", "sunset"), POSIXct.out=FALSE)
+\S4method{solarnoon}{SpatialPoints,POSIXct}(crds, dateTime, POSIXct.out=FALSE)
+\S4method{solarnoon}{matrix,POSIXct}(crds, dateTime, proj4string=CRS("+proj=longlat +datum=WGS84"),
+ POSIXct.out=FALSE)
+\S4method{solarpos}{SpatialPoints,POSIXct}(crds, dateTime, ...)
+\S4method{solarpos}{matrix,POSIXct}(crds, dateTime, proj4string=CRS("+proj=longlat +datum=WGS84"), ...)
+
+}
+
+
+\arguments{
+
+ \item{crds}{a \code{SpatialPoints} or \code{matrix} object, containing
+ x and y coordinates (in that order).}
+
+ \item{dateTime}{a POSIXct object with the date and time associated to
+ calculate ephemerides for points given in crds.}
+
+ \item{solarDep}{numeric vector with the angle of the sun below the
+ horizon in degrees.}
+
+ \item{direction}{one of "dawn", "dusk", "sunrise", or "sunset",
+ indicating which ephemerides should be calculated.}
+
+ \item{POSIXct.out}{logical indicating whether POSIXct output should be
+ included.}
+
+ \item{proj4string}{string with valid projection string describing the
+ projection of data in \code{crds}.}
+
+ \item{\dots}{other arguments passed through.}
+
+}
+
+
+\details{NOAA used the reference below to develop their Sunrise/Sunset
+
+\url{http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html} and Solar
+Position
+
+\url{http://www.srrb.noaa.gov/highlights/sunrise/azel.html}
+Calculators. The algorithms include corrections for atmospheric
+refraction effects.
+
+Input can consist of one location and at least one POSIXct times, or one
+POSIXct time and at least one location. \var{solarDep} is recycled as
+needed.
+
+Do not use the daylight savings time zone string for supplying
+\var{dateTime}, as many OS will not be able to properly set it to
+standard time when needed.}
+
+
+\section{Warning}{Compared to NOAA's original Javascript code, the
+sunrise and sunset estimates from this translation may differ by +/- 1
+minute, based on tests using selected locations spanning the globe.
+This translation does not include calculation of prior or next
+sunrises/sunsets for locations above the Arctic Circle or below the
+Antarctic Circle.}
+
+
+\value{\code{crepuscule}, \code{sunriset}, and \code{solarnoon} return a
+ numeric vector with the time of day at which the event occurs,
+ expressed as a fraction, if POSIXct.out is FALSE; otherwise they
+ return a data frame with both the fraction and the corresponding
+ POSIXct date and time. \code{solarpos} returns a matrix with the solar
+ azimuth (in degrees from North), and elevation.}
+
+
+\note{NOAA notes that \dQuote{for latitudes greater than 72 degrees N
+and S, calculations are accurate to within 10 minutes. For latitudes
+less than +/- 72 degrees accuracy is approximately one minute.}}
+
+
+\references{
+ Meeus, J. (1991) Astronomical Algorithms. Willmann-Bell, Inc.
+}
+
+\author{Sebastian P. Luque \email{spluque at gmail.com}, translated from
+ Greg Pelletier's \email{gpel461 at ecy.wa.gov} VBA code (available from
+ \url{http://www.ecy.wa.gov/programs/eap/models.html}), who in turn
+ translated it from original Javascript code by NOAA (see Details).
+ Roger Bivand \email{roger.bivand at nhh.no} adapted the code to work with
+ \pkg{sp} classes.}
+
+\examples{
+## Location of Helsinki, Finland, in decimal degrees,
+## as listed in NOAA's website
+hels <- matrix(c(24.97, 60.17), nrow=1)
+Hels <- SpatialPoints(hels, proj4string=CRS("+proj=longlat +datum=WGS84"))
+d041224 <- as.POSIXct("2004-12-24", tz="EET")
+## Astronomical dawn
+crepuscule(hels, d041224, solarDep=18, direction="dawn", POSIXct.out=TRUE)
+crepuscule(Hels, d041224, solarDep=18, direction="dawn", POSIXct.out=TRUE)
+## Nautical dawn
+crepuscule(hels, d041224, solarDep=12, direction="dawn", POSIXct.out=TRUE)
+crepuscule(Hels, d041224, solarDep=12, direction="dawn", POSIXct.out=TRUE)
+## Civil dawn
+crepuscule(hels, d041224, solarDep=6, direction="dawn", POSIXct.out=TRUE)
+crepuscule(Hels, d041224, solarDep=6, direction="dawn", POSIXct.out=TRUE)
+solarnoon(hels, d041224, POSIXct.out=TRUE)
+solarnoon(Hels, d041224, POSIXct.out=TRUE)
+solarpos(hels, as.POSIXct(Sys.time(), tz="EET"))
+solarpos(Hels, as.POSIXct(Sys.time(), tz="EET"))
+sunriset(hels, d041224, direction="sunrise", POSIXct.out=TRUE)
+sunriset(Hels, d041224, direction="sunrise", POSIXct.out=TRUE)
+## Using a sequence of dates
+Hels_seq <- seq(from=d041224, length.out=365, by="days")
+up <- sunriset(Hels, Hels_seq, direction="sunrise", POSIXct.out=TRUE)
+down <- sunriset(Hels, Hels_seq, direction="sunset", POSIXct.out=TRUE)
+day_length <- down$time - up$time
+plot(Hels_seq, day_length, type="l")
+
+## Using a grid of spatial points for the same point in time
+grd <- GridTopology(c(-179,-89), c(1,1), c(359,179))
+SP <- SpatialPoints(coordinates(grd),
+ proj4string=CRS("+proj=longlat +datum=WGS84"))
+wint <- as.POSIXct("2004-12-21", tz="GMT")
+win <- crepuscule(SP, wint, solarDep=6, direction="dawn")
+SPDF <- SpatialGridDataFrame(grd,
+ proj4string=CRS("+proj=longlat +datum=WGS84"),
+ data=data.frame(winter=win))
+image(SPDF, axes=TRUE, col=cm.colors(40))
+}
+
+\keyword{methods}
+\keyword{manip}
+\keyword{utilities}
diff --git a/man/symbolsInPolys.Rd b/man/symbolsInPolys.Rd
new file mode 100644
index 0000000..8cc94b5
--- /dev/null
+++ b/man/symbolsInPolys.Rd
@@ -0,0 +1,56 @@
+\name{symbolsInPolys}
+\alias{symbolsInPolys}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Place grids of points over polygons}
+\description{
+ Place grids of points over polygons with chosen density and/or symbols (suggested by Michael Wolf).
+}
+\usage{
+symbolsInPolys(pl, dens, symb = "+", compatible = FALSE)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{pl}{list of polygons of class \code{polylist}}
+ \item{dens}{number of symbol plotting points per unit area; either a single numerical value for all polygons, or a numeric vector the same length as pl with values for each polygon}
+ \item{symb}{plotting symbol; either a single value for all polygons, or a vector the same length as pl with values for each polygon}
+ \item{compatible}{what to return, if TRUE a a list of matrices of point coordinates, one matrix for each member of pl, with a \code{symb} attribute, if false a SpatialPointsDataFrame with a \code{symb} column}
+}
+\details{
+ The dots are placed in a grid pattern with the number of points per polygon being polygon area times density (number of dots not guaranteed to be the same as the count). When the polygon is made up of more than one part, the dots will be placed in proportion to the relative areas of the clockwise rings (anticlockwise are taken as holes). From maptools release 0.5-2, correction is made for holes in the placing of the dots, but depends on hole values being correctly set, which they often [...]
+}
+
+\value{
+The function returns a list of matrices of point coordinates, one matrix for each member of pl; each matrix has a \code{symb} attribute that can be used for setting the \code{pch} argument for plotting. If the count of points for the given density and polygon area is zero, the list element is NULL, and can be tested when plotting - see the examples.
+}
+
+\note{Extension to plot pixmaps at the plotting points using addlogo() from the pixmap package is left as an exercise for the user.}
+
+\author{Roger Bivand \email{Roger.Bivand at nhh.no}}
+
+\seealso{\code{\link[sp]{spsample}}}
+
+\examples{
+x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])
+ncpolys <- Map2poly(x)
+np <- sapply(ncpolys, function(x) attr(x, "nPart"))
+symbs <- c("-", "+", "x")
+try1 <- symbolsInPolys(ncpolys, 100, symb=symbs[np], compatible=TRUE)
+plot(ncpolys)
+xx <- lapply(try1, function(x) {if (!is.null(x)) points(x, pch=attr(x, "symb"))})
+nc_SP <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ proj4string=CRS("+proj=longlat +ellps=clrk66"))
+\dontrun{
+library(spgpc)
+pls <- slot(nc_SP, "polygons")
+pls_new <- lapply(pls, checkPolygonsHoles)
+nc_SP <- SpatialPolygonsDataFrame(SpatialPolygons(pls_new,
+ proj4string=CRS(proj4string(nc_SP))), data=as(nc_SP, "data.frame"))
+}
+symbs <- c("-", "+", "x")
+np <- sapply(slot(nc_SP, "polygons"), function(x) length(slot(x, "Polygons")))
+try1 <- symbolsInPolys(nc_SP, 100, symb=symbs[np])
+plot(nc_SP, axes=TRUE)
+plot(try1, add=TRUE, pch=as.character(try1$symb))
+}
+\keyword{spatial}
+
diff --git a/man/unionSpatialPolygons.Rd b/man/unionSpatialPolygons.Rd
new file mode 100644
index 0000000..d4856f5
--- /dev/null
+++ b/man/unionSpatialPolygons.Rd
@@ -0,0 +1,34 @@
+\name{unionSpatialPolygons}
+\alias{unionSpatialPolygons}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Aggregate Polygons in a SpatialPolygons object}
+\description{
+ The function aggregates Polygons in a SpatialPolygons object, according to the IDs vector specifying which input Polygons belong to which output Polygons; internal boundaries are dissolved using the gpclib package union() function.
+}
+\usage{
+unionSpatialPolygons(SpP, IDs, threshold=NULL)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{SpP}{A SpatialPolygons object as defined in package sp}
+ \item{IDs}{A vector defining the output Polygons objects, equal in length to the length of the polygons slot of SpRs; it may be character, integer, or factor (try table(factor(IDs)) for a sanity check)}
+ \item{threshold}{if not NULL, an area measure below which slivers will be discarded (some polygons have non-identical boundaries, for instance along rivers, generating slivers on union which are artefacts, not real sub-polygons)}
+}
+
+\value{
+ Returns an aggregated SpatialPolygons object named with the aggregated IDs values in their sorting order; see the ID values of the output object to view the order.
+}
+
+\author{Roger Bivand}
+
+\examples{
+library(sp)
+library(gpclib)
+nc1 <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
+ proj4string=CRS("+proj=longlat +datum=NAD27"))
+lps <- coordinates(nc1)
+ID <- cut(lps[,1], quantile(lps[,1]), include.lowest=TRUE)
+reg4 <- unionSpatialPolygons(nc1, ID)
+sapply(slot(reg4, "polygons"), function(i) slot(i, "ID"))
+}
+\keyword{spatial}
diff --git a/man/write.linelistShape.Rd b/man/write.linelistShape.Rd
new file mode 100644
index 0000000..dccd172
--- /dev/null
+++ b/man/write.linelistShape.Rd
@@ -0,0 +1,48 @@
+\name{write.linelistShape}
+\alias{write.linelistShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Write a arc-type shapefile}
+\description{
+ The function calls code from shapelib to write an arc-type shapefile from a list of matrices of line coordinates with no NAs.
+}
+\usage{
+write.linelistShape(linelist, df, file, factor2char = TRUE,
+ strictFilename=FALSE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{linelist}{a list of matrices of line coordinates}
+ \item{df}{a data frame object}
+ \item{file}{a file name of maximum 8 chararacters, numbers or the underscore symbol to be written, omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{strictFilename}{if TRUE, impose file basename length limit of 8 characters}
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+\details{
+ The function calls code from shapelib to write an arc-type shapefile (both the geometry file with a *.shp extension, the index file with a *.shx extension, and the database file with a *.dbf extension - see \code{\link[foreign]{write.dbf}} for details of the data frame export within this function.
+}
+\value{
+ no return value.
+}
+\references{\url{http://shapelib.maptools.org/}}
+\author{Nicholas J. Lewin-Koh, modified by Roger Bivand; shapelib by Frank Warmerdam}
+\note{From maptools 0.4-10, this function is placed in the user-visible namespace on a trial basis, and reports of any malfunction should be sent to the package maintainer, Roger Bivand \email{Roger.Bivand at nhh.no}. It is likely that this function and its arguments will be changed.}
+
+\seealso{\code{\link{write.pointShape}}, \code{\link[foreign]{write.dbf}}}
+\examples{
+x <- 10 * 1:nrow(volcano)
+y <- 10 * 1:ncol(volcano)
+line.list <- contourLines(x, y, volcano)
+vol.levels <- data.frame(alt=sapply(line.list, function(x) x[[1]]))
+vol.ll <- lapply(line.list, function(x) cbind(x$x, x$y))
+for (i in seq(along=vol.ll)) {
+ attr(vol.ll[[i]], "nParts") <- as.integer(1)
+ attr(vol.ll[[i]], "pstart") <- list(as.integer(1),
+ as.integer(nrow(vol.ll[[i]])))
+}
+tmpshp <- paste(tempdir(), "volcano", sep="/")
+write.linelistShape(vol.ll, vol.levels, file=tmpshp)
+try1 <- readShapeLines(tmpshp)
+plot(try1)
+}
+\keyword{spatial}
diff --git a/man/write.pointShape.Rd b/man/write.pointShape.Rd
new file mode 100644
index 0000000..42df421
--- /dev/null
+++ b/man/write.pointShape.Rd
@@ -0,0 +1,48 @@
+\name{write.pointShape}
+\alias{write.pointShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Write a point-type shapefile}
+\description{
+ The function calls code from shapelib to write a point-type shapefile.
+}
+\usage{
+write.pointShape(coordinates, df, file, factor2char = TRUE,
+ strictFilename=FALSE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{coordinates}{a 2-column numeric matrix of coordinates}
+ \item{df}{a data frame object}
+ \item{file}{a file name of maximum 8 chararacters, numbers or the underscore symbol to be written, omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{strictFilename}{if TRUE, impose file basename length limit of 8 characters}
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+
+\details{
+ The function calls code from shapelib to write a point-type shapefile (both the geometry file with a *.shp extension, the index file with a *.shx extension, and the database file with a *.dbf extension - see \code{\link[foreign]{write.dbf}} for details of the data frame export within this function.
+}
+\value{
+ no return value.
+}
+
+\references{\url{http://shapelib.maptools.org/}}
+
+\author{Nicholas J. Lewin-Koh, modified by Roger Bivand; shapelib by Frank Warmerdam}
+
+\note{From maptools 0.4-7, this function is placed in the user-visible namespace on a trial basis, and reports of any malfunction should be sent to the package maintainer, Roger Bivand \email{Roger.Bivand at nhh.no}. It is likely that this function and its arguments will be changed.}
+
+\seealso{\code{\link[foreign]{write.dbf}}}
+\examples{
+balt_orig <- readShapePoints(system.file("shapes/baltim.shp", package="maptools")[1])
+plot(balt_orig)
+balt_cheap <- balt_orig[balt_orig$PRICE < 40,]
+file <- tempfile("")
+write.pointShape(coordinates=coordinates(balt_cheap),
+ df=as(balt_cheap, "data.frame"), file)
+getinfo.shape(paste(file, ".shp", sep=""))
+balt_new <- readShapePoints(paste(file, ".shp", sep=""))
+plot(balt_new, col="red", pch=16, add=TRUE)
+}
+\keyword{spatial}
+
diff --git a/man/write.polylistShape.Rd b/man/write.polylistShape.Rd
new file mode 100644
index 0000000..2b123a5
--- /dev/null
+++ b/man/write.polylistShape.Rd
@@ -0,0 +1,50 @@
+\name{write.polylistShape}
+\alias{write.polylistShape}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{Write a polygon-type shapefile}
+\description{
+ The function calls code from shapelib to write a polygon-type shapefile from an S3 polylist object.
+}
+\usage{
+write.polylistShape(polylist, df, file, factor2char = TRUE,
+ strictFilename=FALSE, force = TRUE, max_nchar=254)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{polylist}{list of polygons of class \code{polylist}}
+ \item{df}{a data frame object}
+ \item{file}{a file name of maximum 8 chararacters, numbers or the underscore symbol to be written, omitting the extensions *.shp, *.shx and *.dbf, which are added in the function}
+ \item{factor2char}{logical, default TRUE, convert factor columns to character}
+ \item{strictFilename}{if TRUE, impose file basename length limit of 8 characters}
+ \item{force}{default TRUE, to try to force malformed polylist objects to some reasonable form that will not cause both maptools and R to crash. Because polylist objects are old-style rather than new-style classes, it is possible to crash R by trying to write malformed objects. Attempts are made to check for known problems, but using polylist objects rather than sp SpatialPolygons objects is known to be more risky. From release 0.6-14, polylist objects will be given an nDims attribute a [...]
+ \item{max_nchar}{default 254, may be set to a higher limit and passed through to the DBF writer, please see Details in \code{\link[foreign]{write.dbf}}}
+}
+\details{
+ The function calls code from shapelib to write a polygon-type shapefile (both the geometry file with a *.shp extension, the index file with a *.shx extension, and the database file with a *.dbf extension - see \code{\link[foreign]{write.dbf}} for details of the data frame export within this function.
+}
+\value{
+ no return value.
+}
+\references{\url{http://shapelib.maptools.org/}}
+
+\author{Nicholas J. Lewin-Koh, modified by Roger Bivand; shapelib by Frank Warmerdam}
+
+\note{From maptools 0.4-7, this function is placed in the user-visible namespace on a trial basis, and reports of any malfunction should be sent to the package maintainer, Roger Bivand \email{Roger.Bivand at nhh.no}. It is likely that this function and its arguments will be changed.}
+
+\seealso{\code{\link{write.pointShape}}, \code{\link[foreign]{write.dbf}}}
+\examples{
+col_orig <- read.shape(system.file("shapes/columbus.shp", package="maptools")[1])
+mappolys <- Map2poly(col_orig, as.character(col_orig$att.data$NEIGNO))
+plot(mappolys)
+col_df <- col_orig$att.data
+col_cheap <- subset(mappolys, col_df$HOVAL < 34)
+col_df_cheap <- subset(col_df, col_df$HOVAL < 34)
+file <- tempfile("")
+write.polylistShape(col_cheap, col_df_cheap, file)
+getinfo.shape(paste(file, ".shp", sep=""))
+col_new <- read.shape(paste(file, ".shp", sep=""))
+mappolys <- Map2poly(col_new, as.character(col_new$att.data$NEIGNO))
+plot(mappolys, border="red", add=TRUE)
+}
+\keyword{spatial}
+
diff --git a/man/wrld_simpl.Rd b/man/wrld_simpl.Rd
new file mode 100644
index 0000000..eadee29
--- /dev/null
+++ b/man/wrld_simpl.Rd
@@ -0,0 +1,38 @@
+\name{wrld_simpl}
+\alias{wrld_simpl}
+\docType{data}
+\title{Simplified world country polygons}
+\description{
+ The object loaded is a \code{SpatialPolygonsDataFrame} object containing a slightly modified version of Bjoern Sandvik's improved version of world\_borders.zip - TM\_WORLD\_BORDERS\_SIMPL-0.2.zip dataset from the Mapping Hacks geodata site. The country Polygons objects and the data slot data frame row numbers have been set to the ISO 3166 three letter codes.
+}
+\usage{data(wrld_simpl)}
+\format{
+ The format is:
+Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots; the data
+clot contains a data.frame with 246 obs. of 11 variables:
+ \describe{
+ \item{FIPS}{factor of FIPS country codes}
+ \item{ISO2}{factor of ISO 2 character country codes}
+ \item{ISO3}{factor of ISO 3 character country codes}
+ \item{UN}{integer vector of UN country codes}
+ \item{NAME}{Factor of country names}
+ \item{AREA}{integer vector of area values}
+ \item{POP2005}{integer vector of population in 2005}
+ \item{REGION}{integer vector of region values}
+ \item{SUBREGION}{integer vector of subregion values}
+ \item{LON}{numeric vector of longitude label points}
+ \item{LAT}{numeric vector of latitude label points}
+ }
+The object is in geographical coordinates using the WGS84 datum.
+}
+
+\source{
+ \url{http://mappinghacks.com/data/TM_WORLD_BORDERS_SIMPL-0.2.zip}
+}
+
+\examples{
+data(wrld_simpl)
+plot(wrld_simpl)
+}
+\keyword{datasets}
+
diff --git a/src/Rcentroid.c b/src/Rcentroid.c
new file mode 100644
index 0000000..b0900eb
--- /dev/null
+++ b/src/Rcentroid.c
@@ -0,0 +1,274 @@
+
+/*
+ * Modified for R by Nicholas Lewin-Koh also made modifications for
+ * multipart polygons. Sept 29, 2000
+ */
+
+
+#include <R.h>
+#include <Rinternals.h>
+#include <Rmath.h>
+#include "maptools.h"
+
+SEXP RshpCentrd_2d (SEXP);
+SEXP R_RingCentrd_2d (int , SEXP, double *);
+
+
+/* **************************************************************************
+ * RshpCentrd_2d
+ *
+ * Return the single mathematical / geometric centroid of a potentially
+ * complex/compound RShapeObject
+ *
+ * reject non area SHP Types
+ *
+ * **************************************************************************/
+SEXP RshpCentrd_2d (SEXP call) {
+ int ring, ringPrev, ring_nVertices, rStart, nprts;
+ int i,j,totvert;
+ double Area, ringArea;
+ SEXP ringCentrd, Cent, shape, flag, ringVerts;
+ shape = CADR(call);
+ flag = CADDR(call);
+
+/* if ( !(SHPDimension(INTEGER(getAttrib(shape,install("shp.type")))[0]) */
+/* & SHPD_AREA) ) */
+/* error("Not a class of shape with defined 2d area"); */
+
+ nprts = INTEGER(getAttrib(shape, install("nParts")))[0];
+ Area = 0;
+ if(INTEGER(flag)[0]==0 ||nprts==1){
+ PROTECT(Cent=allocVector(REALSXP, 2));
+ REAL(Cent)[0] = 0.0;
+ REAL(Cent)[1] = 0.0;
+ }
+ else{
+ PROTECT(Cent=allocMatrix(REALSXP, nprts, 2));
+ }
+ /* for each ring in compound / complex object calc the ring cntrd */
+
+ ringPrev = INTEGER(getAttrib(shape, install("nVerts")))[0];
+ totvert = INTEGER(getAttrib(shape, install("nVerts")))[0];
+
+ if(nprts==0) nprts=1;
+ for ( ring = nprts-1; ring >= 0; ring-- ) {
+ rStart = INTEGER(VECTOR_ELT(shape,0))[ring];
+ ring_nVertices = ringPrev - rStart;
+/* Rprintf("ringPrev= %d, rStart=%d, ring_nVertices=%d \n", */
+/* ringPrev, rStart, ring_nVertices); */
+
+ PROTECT(ringVerts=allocMatrix(REALSXP, ring_nVertices, 2));
+ for(i=rStart,j=0;i<ringPrev ;i++,j++){
+ REAL(ringVerts)[j]=REAL(VECTOR_ELT(shape,1))[i];
+ REAL(ringVerts)[j+ring_nVertices]=REAL(VECTOR_ELT(shape,1))[i+totvert];
+ }
+/* Rprintf(" matrix begin %f, matrix end: %f \n", */
+/* REAL(ringVerts)[0],REAL(ringVerts)[(2*ring_nVertices)-1]); */
+ PROTECT(ringCentrd =
+ R_RingCentrd_2d (ring_nVertices, ringVerts, &ringArea));
+/* Rprintf("xcent: %f, ycent: %f, area: %f\n ", */
+/* REAL(ringCentrd)[0],REAL(ringCentrd)[1],ringArea ); */
+
+ /* use Superposition of these rings to build a composite Centroid */
+ /* sum the ring centrds * ringAreas, at the end divide by total area */
+ if(INTEGER(flag)[0]==0 ||nprts==1){
+ REAL(Cent)[0] += REAL(ringCentrd)[0] * ringArea;
+ REAL(Cent)[1] += REAL(ringCentrd)[1] * ringArea;
+ }
+ else{
+ REAL(Cent)[ring]= REAL(ringCentrd)[0];
+ REAL(Cent)[ring+nprts]= REAL(ringCentrd)[1];
+ }
+ Area += ringArea;
+ ringPrev = rStart;
+ UNPROTECT(2);
+ }
+
+ /* hold on the division by AREA until were at the end */
+ if(INTEGER(flag)[0]==0 ||nprts==1){
+ REAL(Cent)[0] = REAL(Cent)[0] / Area;
+ REAL(Cent)[1] = REAL(Cent)[1] / Area;
+ UNPROTECT(1);
+ return ( Cent );
+ }
+ else{
+ UNPROTECT(1);
+ return ( Cent );
+ }
+}
+
+
+/* **************************************************************************
+ * RingCentroid_2d
+ * Copyright (c) 1999, Carl Anderson
+ *
+ * This code is based in part on the earlier work of Frank Warmerdam
+ *
+ *
+ * Return the mathematical / geometric centroid of a single closed ring
+ *
+ * **************************************************************************/
+SEXP R_RingCentrd_2d (int nVert, SEXP xy, double *Area ) {
+ int iv /*, jv */;
+/* int sign_x, sign_y; */
+ double /* dy_Area, */ dx_Area, Cx_accum, Cy_accum, ppx, ppy;
+ double x_base, y_base, x, y;
+ SEXP RingCent;
+/* the centroid of a closed Ring is defined as
+ *
+ * Cx = sum (cx * dArea ) / Total Area
+ * and
+ * Cy = sum (cy * dArea ) / Total Area
+ */
+
+ x_base = REAL(xy)[0];
+ y_base = REAL(xy)[nVert];
+
+ Cy_accum = 0.0;
+ Cx_accum = 0.0;
+
+ ppx = REAL(xy)[1] - x_base;
+ ppy = REAL(xy)[nVert + 1] - y_base;
+ *Area = 0;
+
+/* Skip the closing vector */
+ for ( iv = 2; iv <= nVert - 2; iv++ ) {
+ x = REAL(xy)[iv] - x_base;
+ y = REAL(xy)[nVert + iv] - y_base;
+
+ /* calc the area and centroid of triangle built out of an arbitrary */
+ /* base_point on the ring and each successive pair on the ring */
+
+ /* Area of a triangle is the cross product of its defining vectors */
+ /* Centroid of a triangle is the average of its vertices */
+
+ dx_Area = ((x * ppy) - (y * ppx)) * 0.5;
+ *Area += dx_Area;
+
+ Cx_accum += ( ppx + x ) * dx_Area;
+ Cy_accum += ( ppy + y ) * dx_Area;
+/* #ifdef DEBUG2 */
+/* printf("(ringcentrd_2d) Pp( %f, %f), P(%f, %f)\n", ppx, ppy, x, y); */
+/* printf("(ringcentrd_2d) dA: %f, sA: %f, Cx: %f, Cy: %f \n", */
+/* dx_Area, *Area, Cx_accum, Cy_accum); */
+/* #endif */
+ ppx = x;
+ ppy = y;
+ }
+
+/* #ifdef DEBUG2 */
+/* printf("(ringcentrd_2d) Cx: %f, Cy: %f \n", */
+/* ( Cx_accum / ( *Area * 3) ), ( Cy_accum / (*Area * 3) )); */
+/* #endif */
+
+ /* adjust back to world coords
+ */
+ PROTECT(RingCent=allocVector(REALSXP,2));
+ REAL(RingCent)[0] = ( Cx_accum / ( *Area * 3)) + x_base;
+ REAL(RingCent)[1] = ( Cy_accum / ( *Area * 3)) + y_base;
+ UNPROTECT(1);
+ return (RingCent);
+}
+
+
+/* Modified 24 May 2005 Roger S. Bivand for maptools
+ Written by Joseph O'Rourke
+ orourke at cs.smith.edu
+ October 27, 1995
+
+ Computes the centroid (center of gravity) of an arbitrary
+ simple polygon via a weighted sum of signed triangle areas,
+ weighted by the centroid of each triangle.
+ Reads x,y coordinates from stdin.
+ NB: Assumes points are entered in ccw order!
+ E.g., input for square:
+ 0 0
+ 10 0
+ 10 10
+ 0 10
+ This solves Exercise 12, p.47, of my text,
+ Computational Geometry in C. See the book for an explanation
+ of why this works. Follow links from
+ http://cs.smith.edu/~orourke/
+
+*/
+
+#define DIM 2 /* Dimension of points */
+typedef double tPointd[DIM]; /* type double point */
+
+/*#define PMAX 1000 Max # of pts in polygon */
+/* typedef tPointd *tPolygond; */ /* type double polygon */
+
+double Area2( tPointd a, tPointd b, tPointd c );
+void FindCG( int n, tPointd *P, tPointd CG, double *Areasum2 );
+void Centroid3( tPointd p1, tPointd p2, tPointd p3, tPointd c );
+void RFindCG( int *n, double *x, double *y, double *xc, double *yc,
+ double *area );
+
+void RFindCG( int *n, double *x, double *y, double *xc, double *yc,
+ double *area ) {
+
+ int i, nn;
+ tPointd *P;
+ tPointd CG;
+ double Areasum2;
+ nn = n[0];
+ P = (tPointd *) R_alloc(nn, sizeof(tPointd));
+ for (i=0; i<nn; i++) {
+ P[i][0] = x[i];
+ P[i][1] = y[i];
+ }
+ FindCG(nn, P, CG, &Areasum2);
+ xc[0] = CG[0];
+ yc[0] = CG[1];
+ area[0] = Areasum2/2;
+ return;
+}
+
+/*
+ Returns the cg in CG. Computes the weighted sum of
+ each triangle's area times its centroid. Twice area
+ and three times centroid is used to avoid division
+ until the last moment.
+*/
+void FindCG( int n, tPointd *P, tPointd CG, double *Areasum2)
+{
+ int i;
+ double A2; /* Partial area sum */
+ tPointd Cent3;
+
+ CG[0] = 0;
+ CG[1] = 0;
+ Areasum2[0] = 0;
+ for (i = 1; i < n-1; i++) {
+ Centroid3( P[0], P[i], P[i+1], Cent3 );
+ A2 = Area2( P[0], P[i], P[i+1]);
+ CG[0] += A2 * Cent3[0];
+ CG[1] += A2 * Cent3[1];
+ Areasum2[0] += A2;
+ }
+ CG[0] /= 3 * Areasum2[0];
+ CG[1] /= 3 * Areasum2[0];
+ return;
+}
+/*
+ Returns three times the centroid. The factor of 3 is
+ left in to permit division to be avoided until later.
+*/
+void Centroid3( tPointd p1, tPointd p2, tPointd p3, tPointd c )
+{
+ c[0] = p1[0] + p2[0] + p3[0];
+ c[1] = p1[1] + p2[1] + p3[1];
+ return;
+}
+/*
+ Returns twice the signed area of the triangle determined by a,b,c,
+ positive if a,b,c are oriented ccw, and negative if cw.
+*/
+double Area2( tPointd a, tPointd b, tPointd c )
+{
+ double area;
+ area = (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]);
+ return(area);
+}
+
diff --git a/src/Rgshhs.c b/src/Rgshhs.c
new file mode 100644
index 0000000..0347996
--- /dev/null
+++ b/src/Rgshhs.c
@@ -0,0 +1,378 @@
+/* $Id: Rgshhs.c,v 1.5 2008/05/24 16:27:26 rsbivand Exp $
+ *
+ * PROGRAM: gshhs.c
+ * AUTHOR: Paul Wessel (pwessel at hawaii.edu)
+ * CREATED: JAN. 28, 1996
+ * PURPOSE: To extract ASCII data from binary shoreline data
+ * as described in the 1996 Wessel & Smith JGR Data Analysis Note.
+ * VERSION: 1.1 (Byte flipping added)
+ * 1.2 18-MAY-1999:
+ * Explicit binary open for DOS systems
+ * POSIX.1 compliant
+ * 1.3 08-NOV-1999: Released under GNU GPL
+ * 1.4 05-SEPT-2000: Made a GMT supplement; FLIP no longer needed
+ * 1.5 14-SEPT-2004: Updated to deal with latest GSHHS database (1.3)
+ * 1.6 02-MAY-2006: Updated to deal with latest GSHHS database (1.4)
+ * 1.7 11-NOV-2006: Fixed bug in computing level (&& vs &)
+ * 1.8 31-MAR-2007: Updated to deal with latest GSHHS database (1.5)
+ * 1.9 27-AUG-2007: Handle line data as well as polygon data
+ *
+ * Copyright (c) 1996-2004 by P. Wessel and W. H. F. Smith
+ * See COPYING file for copying and redistribution conditions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Contact info: www.soest.hawaii.edu/pwessel */
+
+/*
+ * This modification of gshhs.c is Copyright (c) 2005-7 Roger Bivand
+ * Modification to swap function taken from Rsystat.c in foreign 071117
+*/
+
+#include "Rgshhs.h"
+#include <R.h>
+#include <Rdefines.h>
+#include <R_ext/Applic.h>
+#include <Rconfig.h>
+
+static void swapb(void *result, int size)
+{
+#ifndef WORDS_BIGENDIAN
+ int i;
+ char *p = result, tmp;
+
+ if (size == 1) return;
+ for (i = 0; i < size/2; i++) {
+ tmp = p[i];
+ p[i] = p[size - i - 1];
+ p[size - i - 1] = tmp;
+ }
+#endif
+}
+
+
+SEXP Rgshhs(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
+
+int getNpols(FILE *);
+
+int gshhs_pipbb(double pt1, double pt2, double *bbs);
+
+int gshhs_between(double x, double low, double up);
+
+
+SEXP Rgshhs(SEXP fn, SEXP mode, SEXP dolim, SEXP lim, SEXP level, SEXP minarea)
+{
+ FILE *fp;
+ double w, e, s, n, area, lon, lat;
+ char source, kind[2] = {'P', 'L'}, *name[2] = {"polygon", "line"};
+ char msg[255];
+ int k, line, max_east = 270000000, info, n_read, /*flip,*/ Level, version, greenwich, src;
+ struct POINT p;
+ struct GSHHS h;
+ int npols, pc=0;
+ SEXP res, resnames, resa, plist, choice, chosen, clip, subset;
+ int i, ipols;
+ signed int fpos;
+ double bb[4], bbi[4];
+ int k1[4], k2[4], j, j1, j2;
+
+ fp = fopen (CHAR(STRING_ELT(fn, 0)), "rb");
+ if (fp == NULL ) {
+ sprintf(msg, "Could not find file %s", CHAR(STRING_ELT(fn, 0)));
+ error(msg);
+
+ }
+
+ npols = getNpols(fp);
+ if (INTEGER_POINTER(mode)[0] == 0) {
+ fclose (fp);
+
+ PROTECT(res = NEW_INTEGER(1)); pc++;
+ INTEGER_POINTER(res)[0] = npols;
+ UNPROTECT(pc); /* res */
+ return(res);
+
+ } else if (INTEGER_POINTER(mode)[0] > 0) {
+
+ rewind(fp);
+
+ PROTECT(res = NEW_LIST(12)); pc++;
+
+ PROTECT(resnames = NEW_CHARACTER(12)); pc++;
+ SET_STRING_ELT(resnames, 0, COPY_TO_USER_STRING("id"));
+ SET_STRING_ELT(resnames, 1, COPY_TO_USER_STRING("n"));
+ SET_STRING_ELT(resnames, 2, COPY_TO_USER_STRING("level"));
+ SET_STRING_ELT(resnames, 3, COPY_TO_USER_STRING("source"));
+ SET_STRING_ELT(resnames, 4, COPY_TO_USER_STRING("greenwich"));
+ SET_STRING_ELT(resnames, 5, COPY_TO_USER_STRING("fpos"));
+ SET_STRING_ELT(resnames, 6, COPY_TO_USER_STRING("area"));
+ SET_STRING_ELT(resnames, 7, COPY_TO_USER_STRING("west"));
+ SET_STRING_ELT(resnames, 8, COPY_TO_USER_STRING("east"));
+ SET_STRING_ELT(resnames, 9, COPY_TO_USER_STRING("south"));
+ SET_STRING_ELT(resnames, 10, COPY_TO_USER_STRING("north"));
+ SET_STRING_ELT(resnames, 11, COPY_TO_USER_STRING("line"));
+ setAttrib(res, R_NamesSymbol, resnames);
+
+ SET_VECTOR_ELT(res, 0, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(res, 1, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(res, 2, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(res, 3, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(res, 4, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(res, 5, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(res, 6, NEW_NUMERIC(npols));
+ SET_VECTOR_ELT(res, 7, NEW_NUMERIC(npols));
+ SET_VECTOR_ELT(res, 8, NEW_NUMERIC(npols));
+ SET_VECTOR_ELT(res, 9, NEW_NUMERIC(npols));
+ SET_VECTOR_ELT(res, 10, NEW_NUMERIC(npols));
+ SET_VECTOR_ELT(res, 11, NEW_INTEGER(npols));
+
+ fpos = (signed int) ftell(fp);
+ n_read = fread ((void *)&h, (size_t)sizeof (struct GSHHS),
+ (size_t)1, fp);
+/* version = (h.flag >> 8) & 255;
+ flip = (version != GSHHS_DATA_VERSION); Take as sign that byte-swabbing is needed */
+/* flip = (! (h.level > 0 && h.level < 5));
+ Take as sign that byte-swabbing is needed */
+ i = 0;
+ while (n_read == 1) {
+/* if (flip) {*/
+ swapb (&h.id, sizeof(int));
+ swapb (&h.n, sizeof(int));
+ /* h.level = swapb ((unsigned int)h.level); */
+ swapb (&h.west, sizeof(int));
+ swapb (&h.east, sizeof(int));
+ swapb (&h.south, sizeof(int));
+ swapb (&h.north, sizeof(int));
+ swapb (&h.area, sizeof(int));
+ /* h.version = swapb ((unsigned int)h.version);
+ h.greenwich = swabi2 ((unsigned int)h.greenwich);
+ h.source = swabi2 ((unsigned int)h.source);*/
+ swapb (&h.flag, sizeof(int));
+/* }*/
+ Level = h.flag & 255;
+ version = (h.flag >> 8) & 255;
+ if (version != GSHHS_DATA_VERSION)
+ error("Data not same version as software");
+ greenwich = (h.flag >> 16) & 255;
+ src = (h.flag >> 24) & 255;
+ w = h.west * GSHHS_SCL;
+/* Convert from microdegrees to degrees */
+ e = h.east * GSHHS_SCL;
+ s = h.south * GSHHS_SCL;
+ n = h.north * GSHHS_SCL;
+ source = (src == 1) ? 'W' : 'C'; /* Either WVS or CIA (WDBII) pedigree */
+ line = (h.area) ? 0 : 1; /* Either Polygon (0) or Line (1) (if no area) */
+ area = 0.1 * h.area;
+/* Now im km^2 */
+ INTEGER_POINTER(VECTOR_ELT(res, 0))[i] = (signed int) h.id;
+ INTEGER_POINTER(VECTOR_ELT(res, 1))[i] = (signed int) h.n;
+ INTEGER_POINTER(VECTOR_ELT(res, 2))[i] =
+ (signed int) Level;
+ INTEGER_POINTER(VECTOR_ELT(res, 3))[i] =
+ (signed int) src;
+ INTEGER_POINTER(VECTOR_ELT(res, 4))[i] =
+ (signed int) greenwich;
+ INTEGER_POINTER(VECTOR_ELT(res, 5))[i] = (signed int) fpos;
+ NUMERIC_POINTER(VECTOR_ELT(res, 6))[i] = area;
+ NUMERIC_POINTER(VECTOR_ELT(res, 7))[i] = w;
+ NUMERIC_POINTER(VECTOR_ELT(res, 8))[i] = e;
+ NUMERIC_POINTER(VECTOR_ELT(res, 9))[i] = s;
+ NUMERIC_POINTER(VECTOR_ELT(res, 10))[i] = n;
+ INTEGER_POINTER(VECTOR_ELT(res, 11))[i] = (signed int) line;
+
+ fseek (fp, (long)(h.n * sizeof(struct POINT)), SEEK_CUR);
+
+ fpos = (signed int) ftell(fp);
+ n_read = fread((void *)&h, (size_t)sizeof (struct GSHHS),
+ (size_t)1, fp);
+ i++;
+ }
+
+ }
+ if (INTEGER_POINTER(mode)[0] == 1) {
+ fclose (fp);
+ UNPROTECT(pc);
+ return(res);
+ } else {
+ if (INTEGER_POINTER(mode)[0] > 1) {
+
+ PROTECT(subset = NEW_INTEGER(npols)); pc++;
+ for (i=0; i<npols; i++) {
+ INTEGER_POINTER(subset)[i] = 1;
+ if (INTEGER_POINTER(VECTOR_ELT(res, 2))[i] >
+ INTEGER_POINTER(level)[0])
+ INTEGER_POINTER(subset)[i] = 0;
+ if (NUMERIC_POINTER(VECTOR_ELT(res, 6))[i] <
+ NUMERIC_POINTER(minarea)[0])
+ INTEGER_POINTER(subset)[i] = 0;
+ }
+
+ if (LOGICAL_POINTER(dolim)[0] == TRUE) {
+ PROTECT(choice = NEW_LIST(2)); pc++;
+ SET_VECTOR_ELT(choice, 0, NEW_INTEGER(npols));
+ SET_VECTOR_ELT(choice, 1, NEW_INTEGER(npols));
+ for (i=0; i<npols; i++) {
+ INTEGER_POINTER(VECTOR_ELT(choice, 0))[i] = 0;
+ INTEGER_POINTER(VECTOR_ELT(choice, 1))[i] = 0;
+ }
+ ipols = 0;
+ bb[0] = NUMERIC_POINTER(lim)[0];
+ bb[1] = NUMERIC_POINTER(lim)[1];
+ bb[2] = NUMERIC_POINTER(lim)[2];
+ bb[3] = NUMERIC_POINTER(lim)[3];
+ for (i=0; i<npols; i++) {
+ if (INTEGER_POINTER(subset)[i] == 1) {
+ j = 0;
+ bbi[0] = NUMERIC_POINTER(VECTOR_ELT(res, 7))[i];
+ bbi[1] = NUMERIC_POINTER(VECTOR_ELT(res, 8))[i];
+ bbi[2] = NUMERIC_POINTER(VECTOR_ELT(res, 9))[i];
+ bbi[3] = NUMERIC_POINTER(VECTOR_ELT(res, 10))[i];
+ for (k=0; k<4; k++) k1[k] = 0;
+ for (k=0; k<4; k++) k2[k] = 0;
+ k1[0] = gshhs_pipbb(bb[0], bb[2], bbi);
+ k1[1] = gshhs_pipbb(bb[0], bb[3], bbi);
+ k1[2] = gshhs_pipbb(bb[1], bb[2], bbi);
+ k1[3] = gshhs_pipbb(bb[1], bb[3], bbi);
+ k2[0] = gshhs_pipbb(bbi[0], bbi[2], bb);
+ k2[1] = gshhs_pipbb(bbi[0], bbi[3], bb);
+ k2[2] = gshhs_pipbb(bbi[1], bbi[2], bb);
+ k2[3] = gshhs_pipbb(bbi[1], bbi[3], bb);
+ for (k=0, j1=0; k<4; k++) j1+= k1[k];
+ for (k=0, j2=0; k<4; k++) j2+= k2[k];
+ INTEGER_POINTER(VECTOR_ELT(choice, 0))[i] = j1;
+ INTEGER_POINTER(VECTOR_ELT(choice, 1))[i] = j2;
+ if (j1 != 0 || j2 != 0) ipols++;
+ }
+ } /* npols */
+ PROTECT(chosen = NEW_INTEGER(ipols)); pc++;
+ PROTECT(clip = NEW_INTEGER(ipols)); pc++;
+ for (i=0, j=0; i<npols; i++) {
+ if (INTEGER_POINTER(VECTOR_ELT(choice, 0))[i] != 0
+ || INTEGER_POINTER(VECTOR_ELT(choice, 1))[i]
+ != 0) {
+ INTEGER_POINTER(chosen)[j] = i;
+ INTEGER_POINTER(clip)[j] = 0;
+ if (INTEGER_POINTER(VECTOR_ELT(choice, 1))[i]
+ != 4) INTEGER_POINTER(clip)[j] = 1;
+ j++;
+ }
+ }
+
+
+ if (INTEGER_POINTER(mode)[0] == 4) {
+ fclose (fp);
+
+ UNPROTECT(pc);
+ return(choice);
+ }
+
+ if (INTEGER_POINTER(mode)[0] == 3) {
+ fclose (fp);
+
+ UNPROTECT(pc);
+ return(clip);
+ }
+
+ } /* dolim */ else {
+ for (i=0, ipols=0; i<npols; i++)
+ ipols += INTEGER_POINTER(subset)[i];
+ PROTECT(chosen = NEW_INTEGER(ipols)); pc++;
+ for (i=0, j=0; i<npols; i++) {
+ if (INTEGER_POINTER(subset)[i] == 1) {
+ INTEGER_POINTER(chosen)[j] = i;
+ j++;
+ }
+ }
+ }
+
+ if (INTEGER_POINTER(mode)[0] == 2) {
+ fclose (fp);
+
+ UNPROTECT(pc);
+ return(chosen);
+ }
+
+ rewind(fp);
+ PROTECT(plist = NEW_LIST(ipols)); pc++;
+ for (i=0; i < ipols; i++) {
+ j = INTEGER_POINTER(chosen)[i];
+ if (j > 1) max_east = 180000000;
+ j1 = INTEGER_POINTER(VECTOR_ELT(res, 1))[j];
+ j2 = INTEGER_POINTER(VECTOR_ELT(res, 5))[j];
+ fseek (fp, (long)(sizeof(struct GSHHS) + j2), SEEK_SET);
+ SET_VECTOR_ELT(plist, i, allocMatrix(REALSXP, j1, 2));
+ for (k = 0; k < j1; k++) {
+ if (fread ((void *)&p,
+ (size_t) sizeof(struct POINT),
+ (size_t) 1, fp) != 1) {
+ sprintf (msg,
+ "Error reading file %s for %s %d, point %d.\n",
+ CHAR(STRING_ELT(fn, 0)), name[line],
+ INTEGER_POINTER(VECTOR_ELT(res, 0))[j], k);
+ error(msg);
+ }
+/* if (flip) {*/
+ swapb (&p.x, sizeof(int));
+ swapb (&p.y, sizeof(int));
+/* }*/
+ lon = (INTEGER_POINTER(VECTOR_ELT(res, 4))[j]
+ && p.x > max_east) ?
+ p.x * GSHHS_SCL - 360.0 : p.x * GSHHS_SCL;
+ lat = p.y * GSHHS_SCL;
+ NUMERIC_POINTER(VECTOR_ELT(plist, i))[k] = lon;
+ NUMERIC_POINTER(VECTOR_ELT(plist, i))[k+j1] = lat;
+ }
+ }
+ fclose (fp);
+
+ UNPROTECT(pc);
+ return(plist);
+ }
+ }
+}
+
+int getNpols(FILE *fp) {
+ struct GSHHS h;
+ int n_read, /*flip,*/ version;
+ int npols;
+ int n;
+
+ n_read = fread ((void *)&h, (size_t)sizeof (struct GSHHS),
+ (size_t)1, fp);
+/* version = (h.flag >> 8) & 255;
+ flip = (version != GSHHS_DATA_VERSION); Take as sign that byte-swabbing is needed */
+/* flip = (! (h.level > 0 && h.level < 5));
+ Take as sign that byte-swabbing is needed */
+
+ n=0;
+ while (n_read == 1) {
+/* if (flip) {*/
+ swapb (&h.n, sizeof(int));
+/* }*/
+ fseek (fp, (long)(h.n * sizeof(struct POINT)), SEEK_CUR);
+ n_read = fread((void *)&h, (size_t)sizeof (struct GSHHS),
+ (size_t)1, fp);
+ n++;
+ }
+
+ return(n);
+}
+
+int gshhs_between(double x, double low, double up) {
+ if (x >= low && x <= up) return(1);
+ else return(0);
+}
+
+int gshhs_pipbb(double pt1, double pt2, double *bbs) {
+ if ((gshhs_between(pt1, bbs[0], bbs[1]) == 1) &&
+ (gshhs_between(pt2, bbs[2], bbs[3]) == 1)) return(1);
+ else return(0);
+}
+
diff --git a/src/Rgshhs.h b/src/Rgshhs.h
new file mode 100644
index 0000000..c888b87
--- /dev/null
+++ b/src/Rgshhs.h
@@ -0,0 +1,80 @@
+/* $Id: Rgshhs.h,v 1.4 2008/05/24 16:27:26 rsbivand Exp $
+ *
+ * Include file defining structures used in gshhs.c
+ *
+ * Paul Wessel, SOEST
+ *
+ * Copyright (c) 1996-2008 by P. Wessel and W. H. F. Smith
+ * See COPYING file for copying and redistribution conditions.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Contact info: www.soest.hawaii.edu/pwessel
+ *
+ * 14-SEP-2004. PW: Version 1.3. Header is now n * 8 bytes (n = 5)
+ * For use with version 1.3 of GSHHS
+ * 2-MAY-2006. PW: Version 1.4. Header is now 32 bytes (all int 4)
+ * For use with version 1.4 of GSHHS
+ * 31-MAR-2007. PW: Version 1.5. no format change
+ * For use with version 1.5 of GSHHS
+ * 28-AUG-2007. PW: Version 1.6. no format change
+ * For use with version 1.6 of GSHHS which now has WDBII
+ * borders and rivers.
+ */
+/*
+This modification of gshhs.h is Copyright (c) 2005-7 Roger Bivand
+*/
+
+#ifndef _GSHHS
+#define _GSHHS
+#define _POSIX_SOURCE 1 /* GSHHS code is POSIX compliant */
+
+/*#include <stdio.h>
+#include <stdlib.h>
+#include <math.h> RSB */
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#ifndef SEEK_CUR /* For really ancient systems */
+#define SEEK_CUR 1
+#endif
+
+#define GSHHS_DATA_VERSION 6 /* For v1.5 data set */
+#define GSHHS_PROG_VERSION "1.9"
+
+#define GSHHS_SCL 1.0e-6 /* COnvert micro-degrees to degrees */
+
+
+/* For byte swapping on little-endian systems (GSHHS is bigendian) */
+
+/* #define swabi2(i2) (((i2) >> 8) + (((i2) & 255) << 8))
+#define swabi4(i4) (((i4) >> 24) + (((i4) >> 8) & 65280) + (((i4) & 65280) << 8) + (((i4) & 255) << 24)) */
+
+struct GSHHS { /* Global Self-consistent Hierarchical High-resolution Shorelines */
+ int id; /* Unique polygon id number, starting at 0 */
+ int n; /* Number of points in this polygon */
+ int flag; /* = level + version << 8 + greenwich << 16 + source << 24 */
+ /* flag contains 4 items, one in each byte, as follows:
+ * low byte: level = flag & 255: Values: 1 land, 2 lake, 3 island_in_lake, 4 pond_in_island_in_lake
+ * 2nd byte: version = (flag >> 8) & 255: Values: Should be 4 for GSHHS version 1.4
+ * 3rd byte: greenwich = (flag >> 16) & 255: Values: Greenwich is 1 if Greenwich is crossed
+ * 4th byte: source = (flag >> 24) & 255: Values: 0 = CIA WDBII, 1 = WVS
+ */
+ int west, east, south, north; /* min/max extent in micro-degrees */
+ int area; /* Area of polygon in 1/10 km^2 */
+};
+
+struct POINT { /* Each lon, lat pair is stored in micro-degrees in 4-byte integer format */
+ int x;
+ int y;
+};
+#endif /* _GSHHS */
diff --git a/src/Rshapeget.c b/src/Rshapeget.c
new file mode 100644
index 0000000..6f7116c
--- /dev/null
+++ b/src/Rshapeget.c
@@ -0,0 +1,248 @@
+/* Copyright (c) 2000-2004, Nicholas J. Lewin-Koh and Roger Bivand */
+
+/*
+ Opens an ESRI shape file and reads the information into a shapelist
+ object
+*/
+
+#include "maptools.h"
+#include <R.h>
+#include <Rdefines.h>
+/* #include <R_ext/PrtUtil.h> */
+
+/*#define DEBUG 1*/
+/*SEXP Rshapeget(SEXP, SEXP);*/
+
+int SHPCheck_SHX( SHPHandle hSHP );
+int SHPCheck_SHX_Geolytics( SHPHandle hSHP );
+
+
+SEXP Rshapeget(SEXP shpnm, SEXP repair)
+
+{
+ SHPHandle hSHP;
+ int nShapeType, nEntities, nImpliedEOF, qRep, i, pc=0;
+ double adfMinBound[4], adfMaxBound[4];
+ int j, pz=0, k;
+ SHPObject *psShape;
+
+ SEXP Rshplst, shplistnms;
+ SEXP temp0, temp1, temp2, temp3;
+
+/*#ifdef DEBUG
+ PT Cent;
+ double Area;
+#endif*/
+
+/* -------------------------------------------------------------------- */
+/* Open the passed shapefile. */
+/* -------------------------------------------------------------------- */
+
+ hSHP = SHPOpen(CHAR(STRING_ELT(shpnm,0)), "rb" );
+ if( hSHP == NULL )
+ error("unable to open SHP or SHX file");
+
+ qRep = LOGICAL_POINTER(repair)[0];
+
+/* file length implied by *.shx */
+ k = SHPCheck_SHX(hSHP);
+ if (k == 1 && qRep == 0) {
+ error("File size and implied file size differ, consider trying repair=TRUE"); /* implied file length greater than file size */
+ }
+
+ if (qRep == 1 && k == 1) {
+ j = SHPCheck_SHX_Geolytics(hSHP);
+ if (j > 0) error("Cannot repair file size error");
+ if (j == 0) {/* Geolytics size + 8 bug */
+ for (i=1; i < hSHP->nRecords; i++)
+ hSHP->panRecSize[i] = hSHP->panRecSize[i] - 8;
+ warning("SHX object size off by 8 bug repaired");
+ }
+ }
+
+
+/* -------------------------------------------------------------------- */
+/* Print out the file bounds. */
+/* -------------------------------------------------------------------- */
+ SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+/* Rprintf("Shapefile Type: %s # of Shapes: %d\n\n",
+ SHPTypeName( nShapeType ), nEntities );*/
+
+ PROTECT(Rshplst=allocVector(VECSXP, nEntities)); pc++;
+
+ PROTECT(temp0=allocVector(STRSXP, 1)); pc++;
+
+ if(nShapeType==1){ /* POINT */
+ SET_STRING_ELT(temp0, 0, mkChar("point"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ }
+ else if(nShapeType==11){ /* POINTZ */
+ SET_STRING_ELT(temp0, 0, mkChar("point"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ pz=1;
+ }
+ else if(nShapeType==3){ /* ARC */
+ SET_STRING_ELT(temp0, 0, mkChar("arc"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ }
+ else if(nShapeType==13){ /* ARCZ */
+ SET_STRING_ELT(temp0, 0, mkChar("arc"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ }
+ else if(nShapeType==5){/* POLYGON */
+ SET_STRING_ELT(temp0, 0, mkChar("poly"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ }
+ else if(nShapeType==15){/* POLYGONZ */
+ SET_STRING_ELT(temp0, 0, mkChar("poly"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ }
+ else if(nShapeType==8){ /* MULTIPOINT */
+ SET_STRING_ELT(temp0, 0, mkChar("point"));
+ setAttrib(Rshplst, install("shp.type"), temp0);
+ }
+ else {
+ Rprintf("Shapefile type: %s (%d), # of Shapes: %d\n\n",
+ SHPTypeName( nShapeType ), nShapeType, nEntities );
+ error("Shapefile type not (yet) handled by this function");
+ }
+
+
+ PROTECT(temp1=allocVector(INTSXP,1)); pc++;
+ INTEGER(temp1)[0] = nEntities;
+ setAttrib(Rshplst,install("nshps"),temp1);
+
+
+ PROTECT(temp2=allocVector(REALSXP,4)); pc++;
+ REAL(temp2)[0] = adfMinBound[0];
+ REAL(temp2)[1] = adfMinBound[1];
+ REAL(temp2)[2] = adfMinBound[2];
+ REAL(temp2)[3] = adfMinBound[3];
+ setAttrib(Rshplst,install("minbb"),temp2);
+
+
+ PROTECT(temp3=allocVector(REALSXP,4)); pc++;
+ REAL(temp3)[0] = adfMaxBound[0];
+ REAL(temp3)[1] = adfMaxBound[1];
+ REAL(temp3)[2] = adfMaxBound[2];
+ REAL(temp3)[3] = adfMaxBound[3];
+ setAttrib(Rshplst,install("maxbb"),temp3);
+
+
+
+/*--------------------------------------------------------------------
+ Skim over the list of shapes, printing all the vertices.
+ --------------------------------------------------------------------*/
+
+ PROTECT(shplistnms = allocVector(STRSXP,7)); pc++;
+ SET_STRING_ELT(shplistnms,0,mkChar("Pstart"));
+ SET_STRING_ELT(shplistnms,1,mkChar("verts"));
+ SET_STRING_ELT(shplistnms,2,mkChar("shp.type"));
+ SET_STRING_ELT(shplistnms,3,mkChar("nVerts"));
+ SET_STRING_ELT(shplistnms,4,mkChar("nParts"));
+ SET_STRING_ELT(shplistnms,5,mkChar("bbox"));
+ SET_STRING_ELT(shplistnms,6,mkChar("shpID"));
+ for( i = 0; i < nEntities; i++ )
+ {
+ psShape = SHPReadObject( hSHP, i);
+ if (psShape == NULL) {/* Jon Wakefield 060428 */
+ Rprintf("Bailing out at geometry object %d of %d\n", i+1, nEntities);
+ SHPClose(hSHP);
+ error("Error in fseek() or fread() reading object from .shp file.");
+ }
+ if(nShapeType==8 && psShape->nVertices > 1){
+ Rprintf("Shapefile type: %s (%d), # of Shapes: %d\n",
+ SHPTypeName( nShapeType ), nShapeType, nEntities );
+ Rprintf("Shape: %d has %d vertices\n", i, psShape->nVertices);
+ error("Multipoint shapefile error");
+ }
+ SET_VECTOR_ELT(Rshplst, i, allocVector(VECSXP, 7));
+ SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),0,
+ allocVector(INTSXP,psShape->nParts));
+ if (pz == 0) SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),1,
+ allocMatrix(REALSXP,psShape->nVertices,2));
+ else SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),1,
+ allocMatrix(REALSXP,psShape->nVertices,3));
+ SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),2,
+ allocVector(INTSXP,1));
+ SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),3,
+ allocVector(INTSXP,1));
+ SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),4,
+ allocVector(INTSXP,1));
+ SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),5,
+ allocVector(REALSXP,4));
+ SET_VECTOR_ELT(VECTOR_ELT(Rshplst,i),6,
+ allocVector(INTSXP,1));
+ INTEGER(VECTOR_ELT(VECTOR_ELT(Rshplst,i),2))[0]=psShape->nSHPType;
+ INTEGER(VECTOR_ELT(VECTOR_ELT(Rshplst,i),3))[0]=psShape->nVertices;
+ INTEGER(VECTOR_ELT(VECTOR_ELT(Rshplst,i),4))[0]=psShape->nParts;
+ INTEGER(VECTOR_ELT(VECTOR_ELT(Rshplst,i),6))[0]=psShape->nShapeId;
+
+
+ REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),5))[0]=psShape->dfXMin;
+ REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),5))[1]=psShape->dfYMin;
+ REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),5))[2]=psShape->dfXMax;
+ REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),5))[3]=psShape->dfYMax;
+
+ setAttrib(VECTOR_ELT(Rshplst,i),R_NamesSymbol,shplistnms);
+
+
+ for( j = 0; j < psShape->nVertices; j++ )
+ {
+ REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),1))[j]=psShape->padfX[j];
+ REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),1))[j+psShape->nVertices]=
+ psShape->padfY[j];
+ if (pz == 1) REAL(VECTOR_ELT(VECTOR_ELT(Rshplst,i),1))[j +
+ 2*(psShape->nVertices)]=psShape->padfZ[j];
+ }
+
+
+ if(psShape->nParts > 0 ){
+
+ if(psShape->nParts == 1){
+ INTEGER(VECTOR_ELT(VECTOR_ELT(Rshplst,i),0))[0]=0;
+
+ }
+ else{
+ for(j = 0; j < psShape->nParts; j++ )
+ {
+ INTEGER(VECTOR_ELT(VECTOR_ELT(Rshplst,i),0))[j]=
+ psShape->panPartStart[j];
+ }
+ }
+
+ }
+ SHPDestroyObject( psShape );
+ }
+ SHPClose(hSHP);
+ UNPROTECT(pc);
+
+
+ return(Rshplst);
+}
+
+int SHPCheck_SHX( SHPHandle hSHP )
+/* checks file length against implied file length in *.shx to guard */
+/* against overrun */
+
+{
+ int result = 0;
+ if ((hSHP->panRecOffset[hSHP->nRecords-1] +
+ hSHP->panRecSize[hSHP->nRecords-1] + 8) > hSHP->nFileSize)
+ result = 1;
+ return( result );
+}
+
+int SHPCheck_SHX_Geolytics( SHPHandle hSHP )
+/* checks for Geolytics Inc. off by 8 bytes malformity in *.shx */
+
+{
+ int i, result;
+ for (i=1, result=0; i < hSHP->nRecords; i++)
+ if (hSHP->panRecOffset[i] != (hSHP->panRecOffset[i-1] +
+ hSHP->panRecSize[i-1])) result++;
+
+ return( result );
+
+}
+
diff --git a/src/Rshapeinfo.c b/src/Rshapeinfo.c
new file mode 100644
index 0000000..fcb89a4
--- /dev/null
+++ b/src/Rshapeinfo.c
@@ -0,0 +1,98 @@
+#include "shapefil.h"
+#include <R.h>
+#include <Rdefines.h>
+
+/* INTERFACE */ void Rshapeinfo(char **, int *, int *, double *, double *);
+
+void Rshapeinfo(char **shpnm, int *Shapetype, int *Entities, double
+ *MinBound, double *MaxBound)
+
+{
+ SHPHandle hSHP;
+ int nShapeType, nEntities, i;
+ double adfMinBound[4], adfMaxBound[4];
+/* const char *pszPlus; */
+/* -------------------------------------------------------------------- */
+/* Open the passed shapefile. */
+/* -------------------------------------------------------------------- */
+ hSHP = SHPOpen( shpnm[0] , "rb" );
+
+ if( hSHP == NULL )
+ {
+/* REprintf( "Unable to open:%s\n", shpnm[0] );
+ exit( 1 ); */
+ error("No such file");
+ }
+
+/* -------------------------------------------------------------------- */
+/* Print out the file bounds. */
+/* -------------------------------------------------------------------- */
+ SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+
+ *Entities = nEntities;
+ *Shapetype = nShapeType;
+ for (i=0;i<4;i++){
+ MinBound[i]=adfMinBound[i];
+ MaxBound[i]=adfMaxBound[i];
+ }
+
+/* Rprintf ("Info for %s\n", shpnm[0]);
+ Rprintf("Shapefile Type: %s(%d) # of Shapes: %ld\n\n",
+ SHPTypeName( nShapeType ), nShapeType, nEntities );
+ Rprintf("File Bounds: (%15.10lg,%15.10lg)\n\t(%15.10lg,%15.10lg)\n",
+ MinBound[0], MinBound[1], MaxBound[0], MaxBound[1] );*/
+
+
+ SHPClose( hSHP );
+ return;
+}
+
+
+
+
+
+SEXP Rshapeinfo1(SEXP shpname)
+
+{
+ SEXP res, nms;
+ SHPHandle hSHP;
+ int nShapeType, nEntities, i, pc=0;
+ double adfMinBound[4], adfMaxBound[4];
+ PROTECT(res = NEW_LIST(5)); pc++;
+ PROTECT(nms = NEW_CHARACTER(5)); pc++;
+ SET_STRING_ELT(nms, 0, COPY_TO_USER_STRING("fname"));
+ SET_STRING_ELT(nms, 1, COPY_TO_USER_STRING("type"));
+ SET_STRING_ELT(nms, 2, COPY_TO_USER_STRING("entities"));
+ SET_STRING_ELT(nms, 3, COPY_TO_USER_STRING("minbounds"));
+ SET_STRING_ELT(nms, 4, COPY_TO_USER_STRING("maxbounds"));
+ setAttrib(res, R_NamesSymbol, nms);
+ SET_VECTOR_ELT(res, 0, NEW_CHARACTER(1));
+ SET_VECTOR_ELT(res, 1, NEW_INTEGER(1));
+ SET_VECTOR_ELT(res, 2, NEW_INTEGER(1));
+ SET_VECTOR_ELT(res, 3, NEW_NUMERIC(4));
+ SET_VECTOR_ELT(res, 4, NEW_NUMERIC(4));
+ SET_STRING_ELT(VECTOR_ELT(res, 0), 0, STRING_ELT(shpname, 0));
+
+/* const char *pszPlus; */
+/* -------------------------------------------------------------------- */
+/* Open the passed shapefile. */
+/* -------------------------------------------------------------------- */
+ hSHP = SHPOpen(CHAR(STRING_ELT(shpname, 0)), "rb" );
+
+ if( hSHP == NULL ) error("Error opening SHP file");
+
+/* -------------------------------------------------------------------- */
+/* Print out the file bounds. */
+/* -------------------------------------------------------------------- */
+ SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
+ INTEGER_POINTER(VECTOR_ELT(res, 1))[0] = nShapeType;
+ INTEGER_POINTER(VECTOR_ELT(res, 2))[0] = nEntities;
+ for (i=0; i<4; i++) {
+ NUMERIC_POINTER(VECTOR_ELT(res, 3))[i] = adfMinBound[i];
+ NUMERIC_POINTER(VECTOR_ELT(res, 4))[i] = adfMaxBound[i];
+ }
+
+ SHPClose( hSHP );
+ UNPROTECT(pc);
+ return(res);
+}
diff --git a/src/Rshapewrite.c b/src/Rshapewrite.c
new file mode 100644
index 0000000..fb5a6f1
--- /dev/null
+++ b/src/Rshapewrite.c
@@ -0,0 +1,55 @@
+/* Copyright (c) 2004-6, Nicholas J. Lewin-Koh and Roger Bivand */
+
+#include "maptools.h"
+
+#include <R.h>
+#include <Rdefines.h>
+
+SEXP shpwritepoint(SEXP fname, SEXP shapes, SEXP ncol)
+
+{
+ SHPHandle hSHP;
+ SHPObject *psShape;
+ int nShapeType, i, nShapes;
+
+ if (INTEGER_POINTER(ncol)[0] == 2) nShapeType = SHPT_POINT;
+ else nShapeType = SHPT_POINTZ;
+
+/* -------------------------------------------------------------------- */
+/* Create the requested layer. */
+/* -------------------------------------------------------------------- */
+
+ hSHP = SHPCreate(R_ExpandFileName(CHAR(STRING_ELT(fname,0))), nShapeType);
+
+ if( hSHP == NULL )
+ {
+ error("Unable to create:%s\n", CHAR(STRING_ELT(fname,0)) );
+ }
+
+ nShapes = LENGTH(shapes)/INTEGER_POINTER(ncol)[0];
+ if (nShapeType == SHPT_POINT) {
+ for (i = 0; i < nShapes; i++) {
+ psShape = SHPCreateObject(nShapeType, -1, 0, NULL, NULL, 1,
+ &NUMERIC_POINTER(shapes)[i], &NUMERIC_POINTER(shapes)[i + nShapes],
+ NULL, NULL);
+
+ SHPWriteObject(hSHP, -1, psShape);
+ SHPDestroyObject(psShape);
+ }
+ } else {
+ for (i = 0; i < nShapes; i++) {
+ psShape = SHPCreateObject(nShapeType, -1, 0, NULL, NULL, 1,
+ &NUMERIC_POINTER(shapes)[i], &NUMERIC_POINTER(shapes)[i + nShapes],
+ &NUMERIC_POINTER(shapes)[i + (2*nShapes)], NULL);
+
+ SHPWriteObject(hSHP, -1, psShape);
+ SHPDestroyObject(psShape);
+ }
+ }
+
+ SHPClose(hSHP);
+
+ return R_NilValue;
+}
+
+
diff --git a/src/Rshapewrite1.c b/src/Rshapewrite1.c
new file mode 100644
index 0000000..92adbc1
--- /dev/null
+++ b/src/Rshapewrite1.c
@@ -0,0 +1,190 @@
+/* Copyright (c) 2004, Nicholas J. Lewin-Koh and Roger Bivand */
+
+#include "maptools.h"
+
+#include <R.h>
+#include <Rdefines.h>
+
+SEXP shpwritepolys(SEXP fname, SEXP shapes)
+{
+ SHPHandle hSHP;
+ SHPObject *psShape;
+ int nShapeType, i, j, k, kk;
+ int nShapes, maxnParts=0, maxnVerts=0, pc=0, nDims;
+ int *nParts, *nVerts, *panPartStart, *from, *to;
+ double *padfX, *padfY, *padfZ;
+ SEXP SnParts, Spstart, SnDims;
+
+ PROTECT(SnDims = NEW_CHARACTER(1)); pc++;
+ SET_STRING_ELT(SnDims, 0, COPY_TO_USER_STRING("nDims"));
+
+ nDims = INTEGER_POINTER(GET_ATTR(shapes, SnDims))[0];
+
+ if (nDims == 2) nShapeType = SHPT_POLYGON;
+ else if (nDims == 3) nShapeType = SHPT_POLYGONZ;
+ else error("Invalid dimension");
+
+/* -------------------------------------------------------------------- */
+/* Create the requested layer. */
+/* -------------------------------------------------------------------- */
+
+ hSHP = SHPCreate(R_ExpandFileName(CHAR(STRING_ELT(fname,0))), nShapeType );
+
+ if( hSHP == NULL )
+ {
+ error("Unable to create:%s\n", CHAR(STRING_ELT(fname,0)) );
+ }
+
+ nShapes = LENGTH(shapes);
+ nParts = (int *) R_alloc((long) nShapes, sizeof(int));
+ nVerts = (int *) R_alloc((long) nShapes, sizeof(int));
+ PROTECT(SnParts = NEW_CHARACTER(1)); pc++;
+ SET_STRING_ELT(SnParts, 0, COPY_TO_USER_STRING("nParts"));
+ PROTECT(Spstart = NEW_CHARACTER(1)); pc++;
+ SET_STRING_ELT(Spstart, 0, COPY_TO_USER_STRING("pstart"));
+
+ for (i = 0; i < nShapes; i++) {
+ nParts[i] = INTEGER_POINTER(GET_ATTR(VECTOR_ELT(shapes, i), SnParts))[0];
+ if (nParts[i] > maxnParts) maxnParts = nParts[i];
+ nVerts[i] = INTEGER_POINTER(VECTOR_ELT(GET_ATTR(VECTOR_ELT(shapes, i),
+ Spstart), 1))[(nParts[i]-1)] - (nParts[i]-1);
+ if (nVerts[i] > maxnVerts) maxnVerts = nVerts[i];
+ }
+ panPartStart = (int *) R_alloc((long) maxnParts, sizeof(int));
+ from = (int *) R_alloc((long) maxnParts, sizeof(int));
+ to = (int *) R_alloc((long) maxnParts, sizeof(int));
+ if (maxnVerts > 1000000 || maxnVerts < 1)
+ error("Old polylist object cannot be exported");
+ padfX = (double *) R_alloc((long) maxnVerts, sizeof(double));
+ padfY = (double *) R_alloc((long) maxnVerts, sizeof(double));
+ if (nShapeType == SHPT_POLYGONZ)
+ padfZ = (double *) R_alloc((long) maxnVerts, sizeof(double));
+
+ for (i = 0; i < nShapes; i++) {
+ kk = 0;
+ for (j = 0; j < nParts[i]; j++) {
+ from[j] = INTEGER_POINTER(VECTOR_ELT(GET_ATTR(VECTOR_ELT(shapes, i),
+ Spstart), 0))[j] - 1;
+ panPartStart[j] = from[j] - j;
+ to[j] = INTEGER_POINTER(VECTOR_ELT(GET_ATTR(VECTOR_ELT(shapes, i),
+ Spstart), 1))[j] - 1;
+ for (k=from[j]; k<=to[j]; k++) {
+ padfX[kk] = NUMERIC_POINTER(VECTOR_ELT(shapes, i))[k];
+ padfY[kk] = NUMERIC_POINTER(VECTOR_ELT(shapes,
+ i))[k+nVerts[i]+(nParts[i]-1)];
+ if (nShapeType == SHPT_POLYGONZ)
+ padfZ[kk] = NUMERIC_POINTER(VECTOR_ELT(shapes,
+ i))[k+2*(nVerts[i]+(nParts[i]-1))];
+
+ kk++;
+ }
+ }
+ if (kk != nVerts[i]) error("wrong number of vertices in polylist");
+
+ if (nShapeType == SHPT_POLYGONZ)
+ psShape = SHPCreateObject(nShapeType, -1, nParts[i], panPartStart,
+ NULL, nVerts[i], padfX, padfY, padfZ, NULL);
+ else psShape = SHPCreateObject(nShapeType, -1, nParts[i], panPartStart,
+ NULL, nVerts[i], padfX, padfY, NULL, NULL);
+
+ SHPWriteObject( hSHP, -1, psShape );
+ SHPDestroyObject( psShape );
+ }
+
+
+
+ SHPClose( hSHP );
+ UNPROTECT(pc);
+
+ return R_NilValue;
+}
+
+
+SEXP shpwritelines(SEXP fname, SEXP shapes)
+{
+ SHPHandle hSHP;
+ SHPObject *psShape;
+ int nShapeType, i, j, k, kk;
+ int nShapes, maxnParts=0, maxnVerts=0, pc=0;
+ int *nParts, *nVerts, *panPartStart, *from, *to;
+ double *padfX, *padfY;
+ SEXP SnParts, Spstart;
+
+ nShapeType = SHPT_ARC;
+
+/* -------------------------------------------------------------------- */
+/* Create the requested layer. */
+/* -------------------------------------------------------------------- */
+
+ hSHP = SHPCreate(R_ExpandFileName(CHAR(STRING_ELT(fname,0))), nShapeType );
+
+ if( hSHP == NULL )
+ {
+ error("Unable to create:%s\n", CHAR(STRING_ELT(fname,0)) );
+ }
+
+ nShapes = GET_LENGTH(shapes);
+ nParts = (int *) R_alloc((long) nShapes, sizeof(int));
+ nVerts = (int *) R_alloc((long) nShapes, sizeof(int));
+ PROTECT(SnParts = NEW_CHARACTER(1)); pc++;
+ SET_STRING_ELT(SnParts, 0, COPY_TO_USER_STRING("nParts"));
+ PROTECT(Spstart = NEW_CHARACTER(1)); pc++;
+ SET_STRING_ELT(Spstart, 0, COPY_TO_USER_STRING("pstart"));
+
+ for (i = 0; i < nShapes; i++) {
+ nParts[i] = INTEGER_POINTER(GET_ATTR(VECTOR_ELT(shapes, i), SnParts))[0];
+ if (nParts[i] > maxnParts) maxnParts = nParts[i];
+ nVerts[i] = INTEGER_POINTER(VECTOR_ELT(GET_ATTR(VECTOR_ELT(shapes, i),
+ Spstart), 1))[(nParts[i]-1)] - (nParts[i]-1);
+ if (nVerts[i] > maxnVerts) maxnVerts = nVerts[i];
+ }
+ panPartStart = (int *) R_alloc((long) maxnParts, sizeof(int));
+ from = (int *) R_alloc((long) maxnParts, sizeof(int));
+ to = (int *) R_alloc((long) maxnParts, sizeof(int));
+/* for (i = 0; i < nShapes; i++) {
+ nVerts[i] = INTEGER_POINTER(GET_DIM(VECTOR_ELT(shapes, i)))[0];
+ if (nVerts[i] > maxnVerts) maxnVerts = nVerts[i];
+ } */
+ if (maxnVerts < 1)
+ error("list object cannot be exported");
+ padfX = (double *) R_alloc((long) maxnVerts, sizeof(double));
+ padfY = (double *) R_alloc((long) maxnVerts, sizeof(double));
+
+ for (i = 0; i < nShapes; i++) {
+ kk = 0;
+ for (j = 0; j < nParts[i]; j++) {
+ from[j] = INTEGER_POINTER(VECTOR_ELT(GET_ATTR(VECTOR_ELT(shapes, i),
+ Spstart), 0))[j] - 1;
+ panPartStart[j] = from[j] - j;
+ to[j] = INTEGER_POINTER(VECTOR_ELT(GET_ATTR(VECTOR_ELT(shapes, i),
+ Spstart), 1))[j] - 1;
+ for (k=from[j]; k<=to[j]; k++) {
+ padfX[kk] = NUMERIC_POINTER(VECTOR_ELT(shapes, i))[k];
+ padfY[kk] = NUMERIC_POINTER(VECTOR_ELT(shapes,
+ i))[k+nVerts[i]+(nParts[i]-1)];
+ kk++;
+ }
+ }
+ if (kk != nVerts[i]) error("wrong number of vertices in polylist");
+
+ psShape = SHPCreateObject(nShapeType, -1, nParts[i], panPartStart,
+ NULL, nVerts[i], padfX, padfY, NULL, NULL);
+/* for (j = 0; j < nVerts[i]; j++) {
+ padfX[j] = NUMERIC_POINTER(VECTOR_ELT(shapes, i))[j];
+ padfY[j] = NUMERIC_POINTER(VECTOR_ELT(shapes, i))[j+nVerts[i]];
+ }
+
+ psShape = SHPCreateObject(nShapeType, -1, 0, NULL, NULL, nVerts[i],
+ padfX, padfY, NULL, NULL);*/
+
+ SHPWriteObject( hSHP, -1, psShape );
+ SHPDestroyObject( psShape );
+ }
+
+ SHPClose( hSHP );
+ UNPROTECT(pc);
+
+ return R_NilValue;
+}
+
+
diff --git a/src/insiders.c b/src/insiders.c
new file mode 100644
index 0000000..ce9d351
--- /dev/null
+++ b/src/insiders.c
@@ -0,0 +1,73 @@
+# include <R.h>
+# include <Rdefines.h>
+
+#define ROFFSET 1
+
+int pipbb(double pt1, double pt2, double *bbs);
+
+int between(double x, double low, double up);
+
+SEXP mtInsiders(SEXP n1, SEXP bbs) {
+
+ int n, pc=0;
+ int i, j, k, k1;
+ double bbi[4], bbj[4];
+ int *yes, jhit[4], hsum;
+ SEXP ans;
+
+ n = INTEGER_POINTER(n1)[0];
+ PROTECT(ans = NEW_LIST(n)); pc++;
+ yes = (int *) R_alloc((long) n, sizeof(int));
+ for (i=0; i < n; i++) {
+ for (j=0; j < n; j++) yes[j] = 0;
+ bbi[0] = NUMERIC_POINTER(bbs)[i];
+ bbi[1] = NUMERIC_POINTER(bbs)[i + n];
+ bbi[2] = NUMERIC_POINTER(bbs)[i + 2*n];
+ bbi[3] = NUMERIC_POINTER(bbs)[i + 3*n];
+ k = 0;
+ for (j=0; j < n; j++) {
+ if (i != j) {
+ hsum = 0;
+ bbj[0] = NUMERIC_POINTER(bbs)[j];
+ bbj[1] = NUMERIC_POINTER(bbs)[j + n];
+ bbj[2] = NUMERIC_POINTER(bbs)[j + 2*n];
+ bbj[3] = NUMERIC_POINTER(bbs)[j + 3*n];
+ for (k1=0; k1 < 4; k1++) jhit[k1] = 0;
+ jhit[0] = pipbb(bbi[2], bbi[3], bbj);
+ jhit[1] = pipbb(bbi[0], bbi[1], bbj);
+ jhit[2] = pipbb(bbi[0], bbi[3], bbj);
+ jhit[3] = pipbb(bbi[2], bbi[1], bbj);
+
+ for (k1=0; k1 < 4; k1++)
+ hsum = hsum + jhit[k1];
+ if (hsum == 4) { yes[j] = 1;
+ k = k + yes[j];
+ }
+ }
+ }
+
+ if (k != 0) {
+ SET_VECTOR_ELT(ans, i, NEW_INTEGER(k));
+ for (j=0, k1=0; j < n; j++) {
+ if (yes[j] > 0)
+ INTEGER_POINTER(VECTOR_ELT(ans,
+ i))[k1++] = j + ROFFSET;
+ }
+ }
+ }
+ UNPROTECT(pc); /* ans */
+ return(ans);
+}
+
+
+int between(double x, double low, double up) {
+ if (x >= low && x <= up) return(1);
+ else return(0);
+}
+
+int pipbb(double pt1, double pt2, double *bbs) {
+ if ((between(pt1, bbs[0], bbs[2]) == 1) &&
+ (between(pt2, bbs[1], bbs[3]) == 1)) return(1);
+ else return(0);
+}
+
diff --git a/src/maptools.h b/src/maptools.h
new file mode 100644
index 0000000..88da145
--- /dev/null
+++ b/src/maptools.h
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <string.h>
+#include "shapefil.h"
+#include <R.h>
+#include <Rinternals.h>
+
+int SHPRingDir_2d ( SHPObject *psCShape, int Ring );
+/* #if R_VERSION < R_Version(1, 2, 0)
+# define STRING_ELT(x,i) (STRING(x)[i])
+# define VECTOR_ELT(x,i) (VECTOR(x)[i])
+# define SET_STRING_ELT(x,i,v) (STRING(x)[i] = (v))
+# define SET_VECTOR_ELT(x,i,v) (VECTOR(x)[i] = (v))
+#endif */
diff --git a/src/pip.c b/src/pip.c
new file mode 100644
index 0000000..8c500f3
--- /dev/null
+++ b/src/pip.c
@@ -0,0 +1,203 @@
+/* Copyright where not otherwise stated Edzer Pebesma 2004,
+copied from sp package */
+
+#define USING_R 1
+#include "S.h"
+
+#ifdef USING_R
+# include <R.h>
+# include <Rdefines.h>
+/* # include <Rinternals.h> */
+# define R_UNIFORM unif_rand()
+# define R_NORMAL norm_rand()
+# define RANDIN seed_in((long *) NULL)
+# define RANDOUT seed_out((long *) NULL)
+# define S_EVALUATOR
+#else /* some S-Plus version; assuming >= 6 for now: */
+# if (!defined(SPLUS_VERSION) || SPLUS_VERSION < 6000)
+# error("no SPLUS_VERSION >= 6.0")
+# endif
+# define SEXP s_object *
+# define PROTECT(x) x
+# define UNPROTECT(x)
+# define R_UNIFORM unif_rand(S_evaluator)
+# define R_NORMAL norm_rand(S_evaluator)
+# define RANDIN seed_in((long *) NULL, S_evaluator)
+# define RANDOUT seed_out((long *) NULL, S_evaluator)
+# define Rprintf printf
+#endif
+
+#ifndef MIN
+# define MIN(a,b) ((a)>(b)?(b):(a))
+#endif
+#ifndef MAX
+# define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+/* polygon structs: */
+typedef struct {
+ double x, y;
+} PLOT_POINT;
+
+typedef struct {
+ PLOT_POINT min, max;
+} MBR;
+
+typedef struct polygon {
+ MBR mbr;
+ int lines;
+ PLOT_POINT *p;
+ int close; /* 1 - is closed polygon */
+} POLYGON;
+
+void setup_poly_minmax(POLYGON *pl);
+static char InPoly(PLOT_POINT q, POLYGON *Poly);
+
+SEXP R_point_in_polygon_mt(SEXP px, SEXP py, SEXP polx, SEXP poly) {
+ int i/*, n*/;
+ PLOT_POINT p;
+ POLYGON pol;
+ SEXP ret;
+
+ S_EVALUATOR
+ pol.lines = LENGTH(polx); /* check later that first == last */
+ pol.p = (PLOT_POINT *) Calloc(pol.lines, PLOT_POINT); /* Calloc does error handling */
+ for (i = 0; i < LENGTH(polx); i++) {
+ pol.p[i].x = NUMERIC_POINTER(polx)[i];
+ pol.p[i].y = NUMERIC_POINTER(poly)[i];
+ }
+ pol.close = (pol.p[0].x == pol.p[pol.lines - 1].x &&
+ pol.p[0].y == pol.p[pol.lines - 1].y);
+ setup_poly_minmax(&pol);
+
+ ret = NEW_INTEGER(LENGTH(px));
+ for (i = 0; i < LENGTH(px); i++) {
+ p.x = NUMERIC_POINTER(px)[i];
+ p.y = NUMERIC_POINTER(py)[i];
+/*
+For each query point q, InPoly returns one of four char's:
+ i : q is strictly interior to P
+ o : q is strictly exterior to P
+ v : q is a vertex of P
+ e : q lies on the relative interior of an edge of P
+*/
+ switch (InPoly(p, &pol)) {
+ case 'i': INTEGER_POINTER(ret)[i] = 1; break;
+ case 'o': INTEGER_POINTER(ret)[i] = 0; break;
+ case 'v': INTEGER_POINTER(ret)[i] = 3; break;
+ case 'e': INTEGER_POINTER(ret)[i] = 2; break;
+ default: INTEGER_POINTER(ret)[i] = -1; break;
+ }
+ }
+ Free(pol.p);
+ return(ret);
+}
+
+void setup_poly_minmax(POLYGON *pl) {
+ int i, n=pl->lines;
+ double minx,maxx,miny,maxy;
+
+ minx=miny=DBL_MAX;
+ maxx=maxy=-DBL_MAX;
+
+ for (i=0;i<n;i++) {
+ minx = MIN(minx, pl->p[i].x);
+ miny = MIN(miny, pl->p[i].y);
+ maxx = MAX(maxx, pl->p[i].x);
+ maxy = MAX(maxy, pl->p[i].y);
+ }
+ pl->mbr.min.x = minx;
+ pl->mbr.min.y = miny;
+ pl->mbr.max.x = maxx;
+ pl->mbr.max.y = maxy;
+}
+
+/*
+This code is described in "Computational Geometry in C" (Second Edition),
+Chapter 7. It is not written to be comprehensible without the
+explanation in that book.
+
+For each query point q, InPoly returns one of four char's:
+ i : q is strictly interior to P
+ o : q is strictly exterior to P
+ v : q is a vertex of P
+ e : q lies on the relative interior of an edge of P
+These represent mutually exclusive categories.
+For an explanation of the code, see Chapter 7 of
+"Computational Geometry in C (Second Edition)."
+
+Written by Joseph O'Rourke, contributions by Min Xu, June 1997.
+Questions to orourke at cs.smith.edu.
+--------------------------------------------------------------------
+This code is Copyright 1998 by Joseph O'Rourke. It may be freely
+redistributed in its entirety provided that this copyright notice is
+not removed.
+--------------------------------------------------------------------
+*/
+
+/*
+InPoly returns a char in {i,o,v,e}. See above for definitions.
+*/
+
+static char InPoly(PLOT_POINT q, POLYGON *Poly)
+{
+ int n = Poly->lines;
+ PLOT_POINT *P=Poly->p;
+
+ int i, i1; /* point index; i1 = i-1 mod n */
+ double x; /* x intersection of e with ray */
+ double xx=q.x, yy=q.y;
+ int Rcross = 0; /* number of right edge/ray crossings */
+ int Lcross = 0; /* number of left edge/ray crossings */
+
+ /* For each edge e=(i-1,i), see if crosses ray. */
+ for( i = 0; i < n; i++ ) {
+ /* First see if q=(0,0) is a vertex. */
+ if (( P[i].x - xx )==0 &&( P[i].y - yy )==0 ) return 'v';
+ i1 = ( i + n - 1 ) % n;
+ /* printf("e=(%d,%d)\t", i1, i); */
+
+ /* if e "straddles" the x-axis... */
+ /* The commented-out statement is logically equivalent to the one
+ following. */
+ /* if( ( ( P[i].y > 0 ) && ( P[i1].y <= 0 ) ) ||
+ ( ( P[i1].y > 0 ) && ( P[i] .y <= 0 ) ) ) { }*/
+
+ if( (( P[i].y - yy ) > 0 ) != (( P[i1].y - yy ) > 0 ) ) {
+
+ /* e straddles ray, so compute intersection with ray. */
+ x = (( P[i].x - xx) *( P[i1].y - yy ) -( P[i1].x - xx ) *( P[i].y - yy )) /
+ (P[i1].y - P[i].y );
+ /* printf("straddles: x = %g\t", x); */
+
+ /* crosses ray if strictly positive intersection. */
+ if (x > 0) Rcross++;
+ }
+ /* printf("Right cross=%d\t", Rcross); */
+
+ /* if e straddles the x-axis when reversed... */
+ /* if( ( ( P[i] .y < 0 ) && ( P[i1].y >= 0 ) ) ||
+ ( ( P[i1].y < 0 ) && ( P[i] .y >= 0 ) ) ) { }*/
+
+ if ( (( P[i].y - yy ) < 0 ) != (( P[i1].y - yy ) < 0 ) ) {
+
+ /* e straddles ray, so compute intersection with ray. */
+ x = (( P[i].x - xx) *( P[i1].y - yy ) -( P[i1].x - xx ) *( P[i].y - yy )) /
+ (P[i1].y - P[i].y);
+ /* printf("straddles: x = %g\t", x); */
+
+ /* crosses ray if strictly positive intersection. */
+ if (x < 0) Lcross++;
+ }
+ /* printf("Left cross=%d\n", Lcross); */
+ }
+
+ /* q on the edge if left and right cross are not the same parity. */
+ if( ( Rcross % 2 ) != (Lcross % 2 ) )
+ return 'e';
+
+ /* q inside iff an odd number of crossings. */
+ if( (Rcross % 2) == 1 )
+ return 'i';
+ else return 'o';
+}
diff --git a/src/shapefil.h b/src/shapefil.h
new file mode 100644
index 0000000..7ea81eb
--- /dev/null
+++ b/src/shapefil.h
@@ -0,0 +1,528 @@
+#ifndef _SHAPEFILE_H_INCLUDED
+#define _SHAPEFILE_H_INCLUDED
+
+/******************************************************************************
+ * $Id: shapefil.h,v 1.1.1.1 2005/09/01 18:21:44 rsbivand Exp $
+ *
+ * Project: Shapelib
+ * Purpose: Primary include file for Shapelib.
+ * Author: Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * This software is available under the following "MIT Style" license,
+ * or at the option of the licensee under the LGPL (see LICENSE.LGPL). This
+ * option is discussed in more detail in shapelib.html.
+ *
+ * --
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: shapefil.h,v $
+ * Revision 1.1.1.1 2005/09/01 18:21:44 rsbivand
+ * Initial import.
+ *
+ * Revision 1.14 2005/03/14 15:21:29 fwarmerdam
+ * updated
+ *
+ * Revision 1.30 2005/01/03 22:30:13 fwarmerdam
+ * added support for saved quadtrees
+ *
+ * Revision 1.29 2004/09/26 20:09:35 fwarmerdam
+ * avoid rcsid warnings
+ *
+ * Revision 1.28 2003/12/29 06:02:18 fwarmerdam
+ * added cpl_error.h option
+ *
+ * Revision 1.27 2003/04/21 18:30:37 warmerda
+ * added header write/update public methods
+ *
+ * Revision 1.26 2002/09/29 00:00:08 warmerda
+ * added FTLogical and logical attribute read/write calls
+ *
+ * Revision 1.25 2002/05/07 13:46:30 warmerda
+ * added DBFWriteAttributeDirectly().
+ *
+ * Revision 1.24 2002/04/10 16:59:54 warmerda
+ * added SHPRewindObject
+ *
+ * Revision 1.23 2002/01/15 14:36:07 warmerda
+ * updated email address
+ *
+ * Revision 1.22 2002/01/15 14:32:00 warmerda
+ * try to improve SHPAPI_CALL docs
+ *
+ * Revision 1.21 2001/11/01 16:29:55 warmerda
+ * move pabyRec into SHPInfo for thread safety
+ *
+ * Revision 1.20 2001/07/20 13:06:02 warmerda
+ * fixed SHPAPI attribute for SHPTreeFindLikelyShapes
+ *
+ * Revision 1.19 2001/05/31 19:20:13 warmerda
+ * added DBFGetFieldIndex()
+ *
+ * Revision 1.18 2001/05/31 18:15:40 warmerda
+ * Added support for NULL fields in DBF files
+ *
+ * Revision 1.17 2001/05/23 13:36:52 warmerda
+ * added use of SHPAPI_CALL
+ *
+ * Revision 1.16 2000/09/25 14:15:59 warmerda
+ * added DBFGetNativeFieldType()
+ *
+ * Revision 1.15 2000/02/16 16:03:51 warmerda
+ * added null shape support
+ *
+ * Revision 1.14 1999/11/05 14:12:05 warmerda
+ * updated license terms
+ *
+ * Revision 1.13 1999/06/02 18:24:21 warmerda
+ * added trimming code
+ *
+ * Revision 1.12 1999/06/02 17:56:12 warmerda
+ * added quad'' subnode support for trees
+ *
+ * Revision 1.11 1999/05/18 19:11:11 warmerda
+ * Added example searching capability
+ *
+ * Revision 1.10 1999/05/18 17:49:38 warmerda
+ * added initial quadtree support
+ *
+ * Revision 1.9 1999/05/11 03:19:28 warmerda
+ * added new Tuple api, and improved extension handling - add from candrsn
+ *
+ * Revision 1.8 1999/03/23 17:22:27 warmerda
+ * Added extern "C" protection for C++ users of shapefil.h.
+ *
+ * Revision 1.7 1998/12/31 15:31:07 warmerda
+ * Added the TRIM_DBF_WHITESPACE and DISABLE_MULTIPATCH_MEASURE options.
+ *
+ * Revision 1.6 1998/12/03 15:48:15 warmerda
+ * Added SHPCalculateExtents().
+ *
+ * Revision 1.5 1998/11/09 20:57:16 warmerda
+ * Altered SHPGetInfo() call.
+ *
+ * Revision 1.4 1998/11/09 20:19:33 warmerda
+ * Added 3D support, and use of SHPObject.
+ *
+ * Revision 1.3 1995/08/23 02:24:05 warmerda
+ * Added support for reading bounds.
+ *
+ * Revision 1.2 1995/08/04 03:17:39 warmerda
+ * Added header.
+ *
+ */
+
+#include <stdio.h>
+
+#ifdef USE_DBMALLOC
+#include <dbmalloc.h>
+#endif
+
+#ifdef USE_CPL
+#include "cpl_error.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/************************************************************************/
+/* Configuration options. */
+/************************************************************************/
+
+/* -------------------------------------------------------------------- */
+/* Should the DBFReadStringAttribute() strip leading and */
+/* trailing white space? */
+/* -------------------------------------------------------------------- */
+#define TRIM_DBF_WHITESPACE
+
+/* -------------------------------------------------------------------- */
+/* Should we write measure values to the Multipatch object? */
+/* Reportedly ArcView crashes if we do write it, so for now it */
+/* is disabled. */
+/* -------------------------------------------------------------------- */
+#define DISABLE_MULTIPATCH_MEASURE
+
+/* -------------------------------------------------------------------- */
+/* SHPAPI_CALL */
+/* */
+/* The following two macros are present to allow forcing */
+/* various calling conventions on the Shapelib API. */
+/* */
+/* To force __stdcall conventions (needed to call Shapelib */
+/* from Visual Basic and/or Dephi I believe) the makefile could */
+/* be modified to define: */
+/* */
+/* /DSHPAPI_CALL=__stdcall */
+/* */
+/* If it is desired to force export of the Shapelib API without */
+/* using the shapelib.def file, use the following definition. */
+/* */
+/* /DSHAPELIB_DLLEXPORT */
+/* */
+/* To get both at once it will be necessary to hack this */
+/* include file to define: */
+/* */
+/* #define SHPAPI_CALL __declspec(dllexport) __stdcall */
+/* #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall */
+/* */
+/* The complexity of the situtation is partly caused by the */
+/* peculiar requirement of Visual C++ that __stdcall appear */
+/* after any "*"'s in the return value of a function while the */
+/* __declspec(dllexport) must appear before them. */
+/* -------------------------------------------------------------------- */
+
+#ifdef SHAPELIB_DLLEXPORT
+# define SHPAPI_CALL __declspec(dllexport)
+# define SHPAPI_CALL1(x) __declspec(dllexport) x
+#endif
+
+#ifndef SHPAPI_CALL
+# define SHPAPI_CALL
+#endif
+
+#ifndef SHPAPI_CALL1
+# define SHPAPI_CALL1(x) x SHPAPI_CALL
+#endif
+
+/* -------------------------------------------------------------------- */
+/* Macros for controlling CVSID and ensuring they don't appear */
+/* as unreferenced variables resulting in lots of warnings. */
+/* -------------------------------------------------------------------- */
+#ifndef DISABLE_CVSID
+# define SHP_CVSID(string) static char cpl_cvsid[] = string; \
+static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
+#else
+# define SHP_CVSID(string)
+#endif
+
+/************************************************************************/
+/* SHP Support. */
+/************************************************************************/
+typedef struct
+{
+ FILE *fpSHP;
+ FILE *fpSHX;
+
+ int nShapeType; /* SHPT_* */
+
+ int nFileSize; /* SHP file */
+
+ int nRecords;
+ int nMaxRecords;
+ int *panRecOffset;
+ int *panRecSize;
+
+ double adBoundsMin[4];
+ double adBoundsMax[4];
+
+ int bUpdated;
+
+ unsigned char *pabyRec;
+ int nBufSize;
+} SHPInfo;
+
+typedef SHPInfo * SHPHandle;
+
+/* -------------------------------------------------------------------- */
+/* Shape types (nSHPType) */
+/* -------------------------------------------------------------------- */
+#define SHPT_NULL 0
+#define SHPT_POINT 1
+#define SHPT_ARC 3
+#define SHPT_POLYGON 5
+#define SHPT_MULTIPOINT 8
+#define SHPT_POINTZ 11
+#define SHPT_ARCZ 13
+#define SHPT_POLYGONZ 15
+#define SHPT_MULTIPOINTZ 18
+#define SHPT_POINTM 21
+#define SHPT_ARCM 23
+#define SHPT_POLYGONM 25
+#define SHPT_MULTIPOINTM 28
+#define SHPT_MULTIPATCH 31
+
+
+/* -------------------------------------------------------------------- */
+/* Part types - everything but SHPT_MULTIPATCH just uses */
+/* SHPP_RING. */
+/* -------------------------------------------------------------------- */
+
+#define SHPP_TRISTRIP 0
+#define SHPP_TRIFAN 1
+#define SHPP_OUTERRING 2
+#define SHPP_INNERRING 3
+#define SHPP_FIRSTRING 4
+#define SHPP_RING 5
+
+/* -------------------------------------------------------------------- */
+/* SHPObject - represents on shape (without attributes) read */
+/* from the .shp file. */
+/* -------------------------------------------------------------------- */
+typedef struct
+{
+ int nSHPType;
+
+ int nShapeId; /* -1 is unknown/unassigned */
+
+ int nParts;
+ int *panPartStart;
+ int *panPartType;
+
+ int nVertices;
+ double *padfX;
+ double *padfY;
+ double *padfZ;
+ double *padfM;
+
+ double dfXMin;
+ double dfYMin;
+ double dfZMin;
+ double dfMMin;
+
+ double dfXMax;
+ double dfYMax;
+ double dfZMax;
+ double dfMMax;
+} SHPObject;
+
+/* -------------------------------------------------------------------- */
+/* SHP API Prototypes */
+/* -------------------------------------------------------------------- */
+SHPHandle SHPAPI_CALL
+ SHPOpen( const char * pszShapeFile, const char * pszAccess );
+SHPHandle SHPAPI_CALL
+ SHPCreate( const char * pszShapeFile, int nShapeType );
+void SHPAPI_CALL
+ SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
+ double * padfMinBound, double * padfMaxBound );
+
+SHPObject SHPAPI_CALL1(*)
+ SHPReadObject( SHPHandle hSHP, int iShape );
+int SHPAPI_CALL
+ SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject );
+
+void SHPAPI_CALL
+ SHPDestroyObject( SHPObject * psObject );
+void SHPAPI_CALL
+ SHPComputeExtents( SHPObject * psObject );
+SHPObject SHPAPI_CALL1(*)
+ SHPCreateObject( int nSHPType, int nShapeId, int nParts,
+ const int * panPartStart, const int * panPartType,
+ int nVertices,
+ const double * padfX, const double * padfY,
+ const double * padfZ, const double * padfM );
+SHPObject SHPAPI_CALL1(*)
+ SHPCreateSimpleObject( int nSHPType, int nVertices,
+ const double * padfX,
+ const double * padfY,
+ const double * padfZ );
+
+int SHPAPI_CALL
+ SHPRewindObject( SHPHandle hSHP, SHPObject * psObject );
+
+void SHPAPI_CALL SHPClose( SHPHandle hSHP );
+void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP );
+
+const char SHPAPI_CALL1(*)
+ SHPTypeName( int nSHPType );
+const char SHPAPI_CALL1(*)
+ SHPPartTypeName( int nPartType );
+
+/* -------------------------------------------------------------------- */
+/* Shape quadtree indexing API. */
+/* -------------------------------------------------------------------- */
+
+/* this can be two or four for binary or quad tree */
+#define MAX_SUBNODE 4
+
+typedef struct shape_tree_node
+{
+ /* region covered by this node */
+ double adfBoundsMin[4];
+ double adfBoundsMax[4];
+
+ /* list of shapes stored at this node. The papsShapeObj pointers
+ or the whole list can be NULL */
+ int nShapeCount;
+ int *panShapeIds;
+ SHPObject **papsShapeObj;
+
+ int nSubNodes;
+ struct shape_tree_node *apsSubNode[MAX_SUBNODE];
+
+} SHPTreeNode;
+
+typedef struct
+{
+ SHPHandle hSHP;
+
+ int nMaxDepth;
+ int nDimension;
+ int nTotalCount;
+
+ SHPTreeNode *psRoot;
+} SHPTree;
+
+SHPTree SHPAPI_CALL1(*)
+ SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth,
+ double *padfBoundsMin, double *padfBoundsMax );
+void SHPAPI_CALL
+ SHPDestroyTree( SHPTree * hTree );
+
+int SHPAPI_CALL
+ SHPWriteTree( SHPTree *hTree, const char * pszFilename );
+SHPTree SHPAPI_CALL
+ SHPReadTree( const char * pszFilename );
+
+int SHPAPI_CALL
+ SHPTreeAddObject( SHPTree * hTree, SHPObject * psObject );
+int SHPAPI_CALL
+ SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject );
+int SHPAPI_CALL
+ SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId );
+
+void SHPAPI_CALL
+ SHPTreeTrimExtraNodes( SHPTree * hTree );
+
+int SHPAPI_CALL1(*)
+ SHPTreeFindLikelyShapes( SHPTree * hTree,
+ double * padfBoundsMin,
+ double * padfBoundsMax,
+ int * );
+int SHPAPI_CALL
+ SHPCheckBoundsOverlap( double *, double *, double *, double *, int );
+
+int SHPAPI_CALL1(*)
+SHPSearchDiskTree( FILE *fp,
+ double *padfBoundsMin, double *padfBoundsMax,
+ int *pnShapeCount );
+
+/************************************************************************/
+/* DBF Support. */
+/************************************************************************/
+typedef struct
+{
+ FILE *fp;
+
+ int nRecords;
+
+ int nRecordLength;
+ int nHeaderLength;
+ int nFields;
+ int *panFieldOffset;
+ int *panFieldSize;
+ int *panFieldDecimals;
+ char *pachFieldType;
+
+ char *pszHeader;
+
+ int nCurrentRecord;
+ int bCurrentRecordModified;
+ char *pszCurrentRecord;
+
+ int bNoHeader;
+ int bUpdated;
+} DBFInfo;
+
+typedef DBFInfo * DBFHandle;
+
+typedef enum {
+ FTString,
+ FTInteger,
+ FTDouble,
+ FTLogical,
+ FTInvalid
+} DBFFieldType;
+
+#define XBASE_FLDHDR_SZ 32
+
+DBFHandle SHPAPI_CALL
+ DBFOpen( const char * pszDBFFile, const char * pszAccess );
+DBFHandle SHPAPI_CALL
+ DBFCreate( const char * pszDBFFile );
+
+int SHPAPI_CALL
+ DBFGetFieldCount( DBFHandle psDBF );
+int SHPAPI_CALL
+ DBFGetRecordCount( DBFHandle psDBF );
+int SHPAPI_CALL
+ DBFAddField( DBFHandle hDBF, const char * pszFieldName,
+ DBFFieldType eType, int nWidth, int nDecimals );
+
+DBFFieldType SHPAPI_CALL
+ DBFGetFieldInfo( DBFHandle psDBF, int iField,
+ char * pszFieldName, int * pnWidth, int * pnDecimals );
+
+int SHPAPI_CALL
+ DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName);
+
+int SHPAPI_CALL
+ DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField );
+double SHPAPI_CALL
+ DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+ DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+ DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField );
+int SHPAPI_CALL
+ DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
+
+int SHPAPI_CALL
+ DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField,
+ int nFieldValue );
+int SHPAPI_CALL
+ DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
+ double dFieldValue );
+int SHPAPI_CALL
+ DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
+ const char * pszFieldValue );
+int SHPAPI_CALL
+ DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField );
+
+int SHPAPI_CALL
+ DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField,
+ const char lFieldValue);
+int SHPAPI_CALL
+ DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
+ void * pValue );
+const char SHPAPI_CALL1(*)
+ DBFReadTuple(DBFHandle psDBF, int hEntity );
+int SHPAPI_CALL
+ DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple );
+
+DBFHandle SHPAPI_CALL
+ DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
+
+void SHPAPI_CALL
+ DBFClose( DBFHandle hDBF );
+void SHPAPI_CALL
+ DBFUpdateHeader( DBFHandle hDBF );
+char SHPAPI_CALL
+ DBFGetNativeFieldType( DBFHandle hDBF, int iField );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ndef _SHAPEFILE_H_INCLUDED */
diff --git a/src/shpopen.c b/src/shpopen.c
new file mode 100644
index 0000000..29efd35
--- /dev/null
+++ b/src/shpopen.c
@@ -0,0 +1,2031 @@
+/******************************************************************************
+ * $Id: shpopen.c,v 1.3 2007/11/16 09:12:40 rsbivand Exp $
+ *
+ * Project: Shapelib
+ * Purpose: Implementation of core Shapefile read/write functions.
+ * Author: Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, 2001, Frank Warmerdam
+ *
+ * This software is available under the following "MIT Style" license,
+ * or at the option of the licensee under the LGPL (see LICENSE.LGPL). This
+ * option is discussed in more detail in shapelib.html.
+ *
+ * --
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: shpopen.c,v $
+ * Revision 1.3 2007/11/16 09:12:40 rsbivand
+ * GSHHS to 1.5
+ *
+ * Revision 1.2 2007/11/10 13:17:42 rsbivand
+ * assert
+ *
+ * Revision 1.1.1.1 2005/09/01 18:21:59 rsbivand
+ * Initial import.
+ *
+ * Revision 1.46 2005/02/11 17:17:46 fwarmerdam
+ * added panPartStart[0] validation
+ *
+ * Revision 1.45 2004/09/26 20:09:48 fwarmerdam
+ * const correctness changes
+ *
+ * Revision 1.44 2003/12/29 00:18:39 fwarmerdam
+ * added error checking for failed IO and optional CPL error reporting
+ *
+ * Revision 1.43 2003/12/01 16:20:08 warmerda
+ * be careful of zero vertex shapes
+ *
+ * Revision 1.42 2003/12/01 14:58:27 warmerda
+ * added degenerate object check in SHPRewindObject()
+ *
+ * Revision 1.41 2003/07/08 15:22:43 warmerda
+ * avoid warning
+ *
+ * Revision 1.40 2003/04/21 18:30:37 warmerda
+ * added header write/update public methods
+ *
+ * Revision 1.39 2002/08/26 06:46:56 warmerda
+ * avoid c++ comments
+ *
+ * Revision 1.38 2002/05/07 16:43:39 warmerda
+ * Removed debugging printf.
+ *
+ * Revision 1.37 2002/04/10 17:35:22 warmerda
+ * fixed bug in ring reversal code
+ *
+ * Revision 1.36 2002/04/10 16:59:54 warmerda
+ * added SHPRewindObject
+ *
+ * Revision 1.35 2001/12/07 15:10:44 warmerda
+ * fix if .shx fails to open
+ *
+ * Revision 1.34 2001/11/01 16:29:55 warmerda
+ * move pabyRec into SHPInfo for thread safety
+ *
+ * Revision 1.33 2001/07/03 12:18:15 warmerda
+ * Improved cleanup if SHX not found, provied by Riccardo Cohen.
+ *
+ * Revision 1.32 2001/06/22 01:58:07 warmerda
+ * be more careful about establishing initial bounds in face of NULL shapes
+ *
+ * Revision 1.31 2001/05/31 19:35:29 warmerda
+ * added support for writing null shapes
+ *
+ * Revision 1.30 2001/05/28 12:46:29 warmerda
+ * Add some checking on reasonableness of record count when opening.
+ *
+ * Revision 1.29 2001/05/23 13:36:52 warmerda
+ * added use of SHPAPI_CALL
+ *
+ * Revision 1.28 2001/02/06 22:25:06 warmerda
+ * fixed memory leaks when SHPOpen() fails
+ *
+ * Revision 1.27 2000/07/18 15:21:33 warmerda
+ * added better enforcement of -1 for append in SHPWriteObject
+ *
+ * Revision 1.26 2000/02/16 16:03:51 warmerda
+ * added null shape support
+ *
+ * Revision 1.25 1999/12/15 13:47:07 warmerda
+ * Fixed record size settings in .shp file (was 4 words too long)
+ * Added stdlib.h.
+ *
+ * Revision 1.24 1999/11/05 14:12:04 warmerda
+ * updated license terms
+ *
+ * Revision 1.23 1999/07/27 00:53:46 warmerda
+ * added support for rewriting shapes
+ *
+ * Revision 1.22 1999/06/11 19:19:11 warmerda
+ * Cleanup pabyRec static buffer on SHPClose().
+ *
+ * Revision 1.21 1999/06/02 14:57:56 kshih
+ * Remove unused variables
+ *
+ * Revision 1.20 1999/04/19 21:04:17 warmerda
+ * Fixed syntax error.
+ *
+ * Revision 1.19 1999/04/19 21:01:57 warmerda
+ * Force access string to binary in SHPOpen().
+ *
+ * Revision 1.18 1999/04/01 18:48:07 warmerda
+ * Try upper case extensions if lower case doesn't work.
+ *
+ * Revision 1.17 1998/12/31 15:29:39 warmerda
+ * Disable writing measure values to multipatch objects if
+ * DISABLE_MULTIPATCH_MEASURE is defined.
+ *
+ * Revision 1.16 1998/12/16 05:14:33 warmerda
+ * Added support to write MULTIPATCH. Fixed reading Z coordinate of
+ * MULTIPATCH. Fixed record size written for all feature types.
+ *
+ * Revision 1.15 1998/12/03 16:35:29 warmerda
+ * r+b is proper binary access string, not rb+.
+ *
+ * Revision 1.14 1998/12/03 15:47:56 warmerda
+ * Fixed setting of nVertices in SHPCreateObject().
+ *
+ * Revision 1.13 1998/12/03 15:33:54 warmerda
+ * Made SHPCalculateExtents() separately callable.
+ *
+ * Revision 1.12 1998/11/11 20:01:50 warmerda
+ * Fixed bug writing ArcM/Z, and PolygonM/Z for big endian machines.
+ *
+ * Revision 1.11 1998/11/09 20:56:44 warmerda
+ * Fixed up handling of file wide bounds.
+ *
+ * Revision 1.10 1998/11/09 20:18:51 warmerda
+ * Converted to support 3D shapefiles, and use of SHPObject.
+ *
+ * Revision 1.9 1998/02/24 15:09:05 warmerda
+ * Fixed memory leak.
+ *
+ * Revision 1.8 1997/12/04 15:40:29 warmerda
+ * Fixed byte swapping of record number, and record length fields in the
+ * .shp file.
+ *
+ * Revision 1.7 1995/10/21 03:15:58 warmerda
+ * Added support for binary file access, the magic cookie 9997
+ * and tried to improve the int32 selection logic for 16bit systems.
+ *
+ * Revision 1.6 1995/09/04 04:19:41 warmerda
+ * Added fix for file bounds.
+ *
+ * Revision 1.5 1995/08/25 15:16:44 warmerda
+ * Fixed a couple of problems with big endian systems ... one with bounds
+ * and the other with multipart polygons.
+ *
+ * Revision 1.4 1995/08/24 18:10:17 warmerda
+ * Switch to use SfRealloc() to avoid problems with pre-ANSI realloc()
+ * functions (such as on the Sun).
+ *
+ * Revision 1.3 1995/08/23 02:23:15 warmerda
+ * Added support for reading bounds, and fixed up problems in setting the
+ * file wide bounds.
+ *
+ * Revision 1.2 1995/08/04 03:16:57 warmerda
+ * Added header.
+ *
+ */
+
+#include "shapefil.h"
+
+#include <math.h>
+#include <limits.h>
+/* #include <assert.h> RSB 071110 */
+#include <R.h>
+#include <Rdefines.h>
+#include <R_ext/Applic.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+SHP_CVSID("$Id: shpopen.c,v 1.3 2007/11/16 09:12:40 rsbivand Exp $")
+
+typedef unsigned char uchar;
+
+#if UINT_MAX == 65535
+typedef long int32;
+#else
+typedef int int32;
+#endif
+
+#ifndef FALSE
+# define FALSE 0
+# define TRUE 1
+#endif
+
+#define ByteCopy( a, b, c ) memcpy( b, a, c )
+#ifndef MAX
+# define MIN(a,b) ((a<b) ? a : b)
+# define MAX(a,b) ((a>b) ? a : b)
+#endif
+
+static int bBigEndian;
+
+
+/************************************************************************/
+/* SwapWord() */
+/* */
+/* Swap a 2, 4 or 8 byte word. */
+/************************************************************************/
+
+static void SwapWord( int length, void * wordP )
+
+{
+ int i;
+ uchar temp;
+
+ for( i=0; i < length/2; i++ )
+ {
+ temp = ((uchar *) wordP)[i];
+ ((uchar *)wordP)[i] = ((uchar *) wordP)[length-i-1];
+ ((uchar *) wordP)[length-i-1] = temp;
+ }
+}
+
+/************************************************************************/
+/* SfRealloc() */
+/* */
+/* A realloc cover function that will access a NULL pointer as */
+/* a valid input. */
+/************************************************************************/
+
+static void * SfRealloc( void * pMem, int nNewSize )
+
+{
+ if( pMem == NULL )
+ return( (void *) malloc(nNewSize) );
+ else
+ return( (void *) realloc(pMem,nNewSize) );
+}
+
+/************************************************************************/
+/* SHPWriteHeader() */
+/* */
+/* Write out a header for the .shp and .shx files as well as the */
+/* contents of the index (.shx) file. */
+/************************************************************************/
+
+void SHPWriteHeader( SHPHandle psSHP )
+
+{
+ uchar abyHeader[100];
+ int i;
+ int32 i32;
+ double dValue;
+ int32 *panSHX;
+
+/* -------------------------------------------------------------------- */
+/* Prepare header block for .shp file. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < 100; i++ )
+ abyHeader[i] = 0;
+
+ abyHeader[2] = 0x27; /* magic cookie */
+ abyHeader[3] = 0x0a;
+
+ i32 = psSHP->nFileSize/2; /* file size */
+ ByteCopy( &i32, abyHeader+24, 4 );
+ if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+
+ i32 = 1000; /* version */
+ ByteCopy( &i32, abyHeader+28, 4 );
+ if( bBigEndian ) SwapWord( 4, abyHeader+28 );
+
+ i32 = psSHP->nShapeType; /* shape type */
+ ByteCopy( &i32, abyHeader+32, 4 );
+ if( bBigEndian ) SwapWord( 4, abyHeader+32 );
+
+ dValue = psSHP->adBoundsMin[0]; /* set bounds */
+ ByteCopy( &dValue, abyHeader+36, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+36 );
+
+ dValue = psSHP->adBoundsMin[1];
+ ByteCopy( &dValue, abyHeader+44, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+44 );
+
+ dValue = psSHP->adBoundsMax[0];
+ ByteCopy( &dValue, abyHeader+52, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+52 );
+
+ dValue = psSHP->adBoundsMax[1];
+ ByteCopy( &dValue, abyHeader+60, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+60 );
+
+ dValue = psSHP->adBoundsMin[2]; /* z */
+ ByteCopy( &dValue, abyHeader+68, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+68 );
+
+ dValue = psSHP->adBoundsMax[2];
+ ByteCopy( &dValue, abyHeader+76, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+76 );
+
+ dValue = psSHP->adBoundsMin[3]; /* m */
+ ByteCopy( &dValue, abyHeader+84, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+84 );
+
+ dValue = psSHP->adBoundsMax[3];
+ ByteCopy( &dValue, abyHeader+92, 8 );
+ if( bBigEndian ) SwapWord( 8, abyHeader+92 );
+
+/* -------------------------------------------------------------------- */
+/* Write .shp file header. */
+/* -------------------------------------------------------------------- */
+ if( fseek( psSHP->fpSHP, 0, 0 ) != 0
+ || fwrite( abyHeader, 100, 1, psSHP->fpSHP ) != 1 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_OpenFailed,
+ "Failure writing .shp header." );
+#endif
+ return;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Prepare, and write .shx file header. */
+/* -------------------------------------------------------------------- */
+ i32 = (psSHP->nRecords * 2 * sizeof(int32) + 100)/2; /* file size */
+ ByteCopy( &i32, abyHeader+24, 4 );
+ if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+
+ if( fseek( psSHP->fpSHX, 0, 0 ) != 0
+ || fwrite( abyHeader, 100, 1, psSHP->fpSHX ) != 1 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_OpenFailed,
+ "Failure writing .shx header." );
+#endif
+ return;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Write out the .shx contents. */
+/* -------------------------------------------------------------------- */
+ panSHX = (int32 *) malloc(sizeof(int32) * 2 * psSHP->nRecords);
+
+ for( i = 0; i < psSHP->nRecords; i++ )
+ {
+ panSHX[i*2 ] = psSHP->panRecOffset[i]/2;
+ panSHX[i*2+1] = psSHP->panRecSize[i]/2;
+ if( !bBigEndian ) SwapWord( 4, panSHX+i*2 );
+ if( !bBigEndian ) SwapWord( 4, panSHX+i*2+1 );
+ }
+
+ if( (int)fwrite( panSHX, sizeof(int32)*2, psSHP->nRecords, psSHP->fpSHX )
+ != psSHP->nRecords )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_OpenFailed,
+ "Failure writing .shx contents." );
+#endif
+ }
+
+ free( panSHX );
+
+/* -------------------------------------------------------------------- */
+/* Flush to disk. */
+/* -------------------------------------------------------------------- */
+ fflush( psSHP->fpSHP );
+ fflush( psSHP->fpSHX );
+}
+
+/************************************************************************/
+/* shpopen() */
+/* */
+/* Open the .shp and .shx files based on the basename of the */
+/* files or either file name. */
+/************************************************************************/
+
+SHPHandle SHPAPI_CALL
+SHPOpen( const char * pszLayer, const char * pszAccess )
+
+{
+ char *pszFullname, *pszBasename;
+ SHPHandle psSHP;
+
+ uchar *pabyBuf;
+ int i;
+ double dValue;
+
+/* -------------------------------------------------------------------- */
+/* Ensure the access string is one of the legal ones. We */
+/* ensure the result string indicates binary to avoid common */
+/* problems on Windows. */
+/* -------------------------------------------------------------------- */
+ if( strcmp(pszAccess,"rb+") == 0 || strcmp(pszAccess,"r+b") == 0
+ || strcmp(pszAccess,"r+") == 0 )
+ pszAccess = "r+b";
+ else
+ pszAccess = "rb";
+
+/* -------------------------------------------------------------------- */
+/* Establish the byte order on this machine. */
+/* -------------------------------------------------------------------- */
+ i = 1;
+ if( *((uchar *) &i) == 1 )
+ bBigEndian = FALSE;
+ else
+ bBigEndian = TRUE;
+
+/* -------------------------------------------------------------------- */
+/* Initialize the info structure. */
+/* -------------------------------------------------------------------- */
+ psSHP = (SHPHandle) calloc(sizeof(SHPInfo),1);
+
+ psSHP->bUpdated = FALSE;
+
+/* -------------------------------------------------------------------- */
+/* Compute the base (layer) name. If there is any extension */
+/* on the passed in filename we will strip it off. */
+/* -------------------------------------------------------------------- */
+ pszBasename = (char *) malloc(strlen(pszLayer)+5);
+ strcpy( pszBasename, pszLayer );
+ for( i = strlen(pszBasename)-1;
+ i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
+ && pszBasename[i] != '\\';
+ i-- ) {}
+
+ if( pszBasename[i] == '.' )
+ pszBasename[i] = '\0';
+
+/* -------------------------------------------------------------------- */
+/* Open the .shp and .shx files. Note that files pulled from */
+/* a PC to Unix with upper case filenames won't work! */
+/* -------------------------------------------------------------------- */
+ pszFullname = (char *) malloc(strlen(pszBasename) + 5);
+ sprintf( pszFullname, "%s.shp", pszBasename );
+ psSHP->fpSHP = fopen(pszFullname, pszAccess );
+ if( psSHP->fpSHP == NULL )
+ {
+ sprintf( pszFullname, "%s.SHP", pszBasename );
+ psSHP->fpSHP = fopen(pszFullname, pszAccess );
+ }
+
+ if( psSHP->fpSHP == NULL )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_OpenFailed,
+ "Unable to open %s.shp or %s.SHP.",
+ pszBasename, pszBasename );
+#endif
+ free( psSHP );
+ free( pszBasename );
+ free( pszFullname );
+ return( NULL );
+ }
+
+ sprintf( pszFullname, "%s.shx", pszBasename );
+ psSHP->fpSHX = fopen(pszFullname, pszAccess );
+ if( psSHP->fpSHX == NULL )
+ {
+ sprintf( pszFullname, "%s.SHX", pszBasename );
+ psSHP->fpSHX = fopen(pszFullname, pszAccess );
+ }
+
+ if( psSHP->fpSHX == NULL )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_OpenFailed,
+ "Unable to open %s.shx or %s.SHX.",
+ pszBasename, pszBasename );
+#endif
+ fclose( psSHP->fpSHP );
+ free( psSHP );
+ free( pszBasename );
+ free( pszFullname );
+ return( NULL );
+ }
+
+ free( pszFullname );
+ free( pszBasename );
+
+/* -------------------------------------------------------------------- */
+/* Read the file size from the SHP file. */
+/* -------------------------------------------------------------------- */
+ pabyBuf = (uchar *) malloc(100);
+ fread( pabyBuf, 100, 1, psSHP->fpSHP );
+
+ psSHP->nFileSize = (pabyBuf[24] * 256 * 256 * 256
+ + pabyBuf[25] * 256 * 256
+ + pabyBuf[26] * 256
+ + pabyBuf[27]) * 2;
+
+/* -------------------------------------------------------------------- */
+/* Read SHX file Header info */
+/* -------------------------------------------------------------------- */
+ if( fread( pabyBuf, 100, 1, psSHP->fpSHX ) != 1
+ || pabyBuf[0] != 0
+ || pabyBuf[1] != 0
+ || pabyBuf[2] != 0x27
+ || (pabyBuf[3] != 0x0a && pabyBuf[3] != 0x0d) )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ ".shx file is unreadable, or corrupt." );
+#endif
+ fclose( psSHP->fpSHP );
+ fclose( psSHP->fpSHX );
+ free( psSHP );
+
+ return( NULL );
+ }
+
+ psSHP->nRecords = pabyBuf[27] + pabyBuf[26] * 256
+ + pabyBuf[25] * 256 * 256 + pabyBuf[24] * 256 * 256 * 256;
+ psSHP->nRecords = (psSHP->nRecords*2 - 100) / 8;
+
+ psSHP->nShapeType = pabyBuf[32];
+
+ if( psSHP->nRecords < 0 || psSHP->nRecords > 256000000 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "Record count in .shp header is %d, which seems\n"
+ "unreasonable. Assuming header is corrupt.",
+ psSHP->nRecords );
+#endif
+ fclose( psSHP->fpSHP );
+ fclose( psSHP->fpSHX );
+ free( psSHP );
+
+ return( NULL );
+ }
+
+/* -------------------------------------------------------------------- */
+/* Read the bounds. */
+/* -------------------------------------------------------------------- */
+ if( bBigEndian ) SwapWord( 8, pabyBuf+36 );
+ memcpy( &dValue, pabyBuf+36, 8 );
+ psSHP->adBoundsMin[0] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+44 );
+ memcpy( &dValue, pabyBuf+44, 8 );
+ psSHP->adBoundsMin[1] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+52 );
+ memcpy( &dValue, pabyBuf+52, 8 );
+ psSHP->adBoundsMax[0] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+60 );
+ memcpy( &dValue, pabyBuf+60, 8 );
+ psSHP->adBoundsMax[1] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+68 ); /* z */
+ memcpy( &dValue, pabyBuf+68, 8 );
+ psSHP->adBoundsMin[2] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+76 );
+ memcpy( &dValue, pabyBuf+76, 8 );
+ psSHP->adBoundsMax[2] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+84 ); /* z */
+ memcpy( &dValue, pabyBuf+84, 8 );
+ psSHP->adBoundsMin[3] = dValue;
+
+ if( bBigEndian ) SwapWord( 8, pabyBuf+92 );
+ memcpy( &dValue, pabyBuf+92, 8 );
+ psSHP->adBoundsMax[3] = dValue;
+
+ free( pabyBuf );
+
+/* -------------------------------------------------------------------- */
+/* Read the .shx file to get the offsets to each record in */
+/* the .shp file. */
+/* -------------------------------------------------------------------- */
+ psSHP->nMaxRecords = psSHP->nRecords;
+
+ psSHP->panRecOffset =
+ (int *) malloc(sizeof(int) * MAX(1,psSHP->nMaxRecords) );
+ psSHP->panRecSize =
+ (int *) malloc(sizeof(int) * MAX(1,psSHP->nMaxRecords) );
+
+ pabyBuf = (uchar *) malloc(8 * MAX(1,psSHP->nRecords) );
+ if( (int) fread( pabyBuf, 8, psSHP->nRecords, psSHP->fpSHX )
+ != psSHP->nRecords )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "Failed to read all values for %d records in .shx file.",
+ psSHP->nRecords );
+#endif
+ /* SHX is short or unreadable for some reason. */
+ fclose( psSHP->fpSHP );
+ fclose( psSHP->fpSHX );
+ free( psSHP->panRecOffset );
+ free( psSHP->panRecSize );
+ free( psSHP );
+
+ return( NULL );
+ }
+
+ for( i = 0; i < psSHP->nRecords; i++ )
+ {
+ int32 nOffset, nLength;
+
+ memcpy( &nOffset, pabyBuf + i * 8, 4 );
+ if( !bBigEndian ) SwapWord( 4, &nOffset );
+
+ memcpy( &nLength, pabyBuf + i * 8 + 4, 4 );
+ if( !bBigEndian ) SwapWord( 4, &nLength );
+
+ psSHP->panRecOffset[i] = nOffset*2;
+ psSHP->panRecSize[i] = nLength*2;
+ }
+ free( pabyBuf );
+
+ return( psSHP );
+}
+
+/************************************************************************/
+/* SHPClose() */
+/* */
+/* Close the .shp and .shx files. */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPClose(SHPHandle psSHP )
+
+{
+ if( psSHP == NULL )
+ return;
+
+/* -------------------------------------------------------------------- */
+/* Update the header if we have modified anything. */
+/* -------------------------------------------------------------------- */
+ if( psSHP->bUpdated )
+ SHPWriteHeader( psSHP );
+
+/* -------------------------------------------------------------------- */
+/* Free all resources, and close files. */
+/* -------------------------------------------------------------------- */
+ free( psSHP->panRecOffset );
+ free( psSHP->panRecSize );
+
+ fclose( psSHP->fpSHX );
+ fclose( psSHP->fpSHP );
+
+ if( psSHP->pabyRec != NULL )
+ {
+ free( psSHP->pabyRec );
+ }
+
+ free( psSHP );
+}
+
+/************************************************************************/
+/* SHPGetInfo() */
+/* */
+/* Fetch general information about the shape file. */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPGetInfo(SHPHandle psSHP, int * pnEntities, int * pnShapeType,
+ double * padfMinBound, double * padfMaxBound )
+
+{
+ int i;
+
+ if( psSHP == NULL )
+ return;
+
+ if( pnEntities != NULL )
+ *pnEntities = psSHP->nRecords;
+
+ if( pnShapeType != NULL )
+ *pnShapeType = psSHP->nShapeType;
+
+ for( i = 0; i < 4; i++ )
+ {
+ if( padfMinBound != NULL )
+ padfMinBound[i] = psSHP->adBoundsMin[i];
+ if( padfMaxBound != NULL )
+ padfMaxBound[i] = psSHP->adBoundsMax[i];
+ }
+}
+
+/************************************************************************/
+/* SHPCreate() */
+/* */
+/* Create a new shape file and return a handle to the open */
+/* shape file with read/write access. */
+/************************************************************************/
+
+SHPHandle SHPAPI_CALL
+SHPCreate( const char * pszLayer, int nShapeType )
+
+{
+ char *pszBasename, *pszFullname;
+ int i;
+ FILE *fpSHP, *fpSHX;
+ uchar abyHeader[100];
+ int32 i32;
+ double dValue;
+
+/* -------------------------------------------------------------------- */
+/* Establish the byte order on this system. */
+/* -------------------------------------------------------------------- */
+ i = 1;
+ if( *((uchar *) &i) == 1 )
+ bBigEndian = FALSE;
+ else
+ bBigEndian = TRUE;
+
+/* -------------------------------------------------------------------- */
+/* Compute the base (layer) name. If there is any extension */
+/* on the passed in filename we will strip it off. */
+/* -------------------------------------------------------------------- */
+ pszBasename = (char *) malloc(strlen(pszLayer)+5);
+ strcpy( pszBasename, pszLayer );
+ for( i = strlen(pszBasename)-1;
+ i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
+ && pszBasename[i] != '\\';
+ i-- ) {}
+
+ if( pszBasename[i] == '.' )
+ pszBasename[i] = '\0';
+
+/* -------------------------------------------------------------------- */
+/* Open the two files so we can write their headers. */
+/* -------------------------------------------------------------------- */
+ pszFullname = (char *) malloc(strlen(pszBasename) + 5);
+ sprintf( pszFullname, "%s.shp", pszBasename );
+ fpSHP = fopen(pszFullname, "wb" );
+ if( fpSHP == NULL )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "Failed to create file %s.",
+ pszFullname );
+#endif
+ return( NULL );
+ }
+
+ sprintf( pszFullname, "%s.shx", pszBasename );
+ fpSHX = fopen(pszFullname, "wb" );
+ if( fpSHX == NULL )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "Failed to create file %s.",
+ pszFullname );
+#endif
+ return( NULL );
+ }
+
+ free( pszFullname );
+ free( pszBasename );
+
+/* -------------------------------------------------------------------- */
+/* Prepare header block for .shp file. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < 100; i++ )
+ abyHeader[i] = 0;
+
+ abyHeader[2] = 0x27; /* magic cookie */
+ abyHeader[3] = 0x0a;
+
+ i32 = 50; /* file size */
+ ByteCopy( &i32, abyHeader+24, 4 );
+ if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+
+ i32 = 1000; /* version */
+ ByteCopy( &i32, abyHeader+28, 4 );
+ if( bBigEndian ) SwapWord( 4, abyHeader+28 );
+
+ i32 = nShapeType; /* shape type */
+ ByteCopy( &i32, abyHeader+32, 4 );
+ if( bBigEndian ) SwapWord( 4, abyHeader+32 );
+
+ dValue = 0.0; /* set bounds */
+ ByteCopy( &dValue, abyHeader+36, 8 );
+ ByteCopy( &dValue, abyHeader+44, 8 );
+ ByteCopy( &dValue, abyHeader+52, 8 );
+ ByteCopy( &dValue, abyHeader+60, 8 );
+
+/* -------------------------------------------------------------------- */
+/* Write .shp file header. */
+/* -------------------------------------------------------------------- */
+ if( fwrite( abyHeader, 100, 1, fpSHP ) != 1 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "Failed to write .shp header." );
+#endif
+ return NULL;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Prepare, and write .shx file header. */
+/* -------------------------------------------------------------------- */
+ i32 = 50; /* file size */
+ ByteCopy( &i32, abyHeader+24, 4 );
+ if( !bBigEndian ) SwapWord( 4, abyHeader+24 );
+
+ if( fwrite( abyHeader, 100, 1, fpSHX ) != 1 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "Failed to write .shx header." );
+#endif
+ return NULL;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Close the files, and then open them as regular existing files. */
+/* -------------------------------------------------------------------- */
+ fclose( fpSHP );
+ fclose( fpSHX );
+
+ return( SHPOpen( pszLayer, "r+b" ) );
+}
+
+/************************************************************************/
+/* _SHPSetBounds() */
+/* */
+/* Compute a bounds rectangle for a shape, and set it into the */
+/* indicated location in the record. */
+/************************************************************************/
+
+static void _SHPSetBounds( uchar * pabyRec, SHPObject * psShape )
+
+{
+ ByteCopy( &(psShape->dfXMin), pabyRec + 0, 8 );
+ ByteCopy( &(psShape->dfYMin), pabyRec + 8, 8 );
+ ByteCopy( &(psShape->dfXMax), pabyRec + 16, 8 );
+ ByteCopy( &(psShape->dfYMax), pabyRec + 24, 8 );
+
+ if( bBigEndian )
+ {
+ SwapWord( 8, pabyRec + 0 );
+ SwapWord( 8, pabyRec + 8 );
+ SwapWord( 8, pabyRec + 16 );
+ SwapWord( 8, pabyRec + 24 );
+ }
+}
+
+/************************************************************************/
+/* SHPComputeExtents() */
+/* */
+/* Recompute the extents of a shape. Automatically done by */
+/* SHPCreateObject(). */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPComputeExtents( SHPObject * psObject )
+
+{
+ int i;
+
+/* -------------------------------------------------------------------- */
+/* Build extents for this object. */
+/* -------------------------------------------------------------------- */
+ if( psObject->nVertices > 0 )
+ {
+ psObject->dfXMin = psObject->dfXMax = psObject->padfX[0];
+ psObject->dfYMin = psObject->dfYMax = psObject->padfY[0];
+ psObject->dfZMin = psObject->dfZMax = psObject->padfZ[0];
+ psObject->dfMMin = psObject->dfMMax = psObject->padfM[0];
+ }
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ psObject->dfXMin = MIN(psObject->dfXMin, psObject->padfX[i]);
+ psObject->dfYMin = MIN(psObject->dfYMin, psObject->padfY[i]);
+ psObject->dfZMin = MIN(psObject->dfZMin, psObject->padfZ[i]);
+ psObject->dfMMin = MIN(psObject->dfMMin, psObject->padfM[i]);
+
+ psObject->dfXMax = MAX(psObject->dfXMax, psObject->padfX[i]);
+ psObject->dfYMax = MAX(psObject->dfYMax, psObject->padfY[i]);
+ psObject->dfZMax = MAX(psObject->dfZMax, psObject->padfZ[i]);
+ psObject->dfMMax = MAX(psObject->dfMMax, psObject->padfM[i]);
+ }
+}
+
+/************************************************************************/
+/* SHPCreateObject() */
+/* */
+/* Create a shape object. It should be freed with */
+/* SHPDestroyObject(). */
+/************************************************************************/
+
+SHPObject SHPAPI_CALL1(*)
+SHPCreateObject( int nSHPType, int nShapeId, int nParts,
+ const int * panPartStart, const int * panPartType,
+ int nVertices, const double *padfX, const double *padfY,
+ const double * padfZ, const double * padfM )
+
+{
+ SHPObject *psObject;
+ int i, bHasM, bHasZ;
+
+ psObject = (SHPObject *) calloc(1,sizeof(SHPObject));
+ psObject->nSHPType = nSHPType;
+ psObject->nShapeId = nShapeId;
+
+/* -------------------------------------------------------------------- */
+/* Establish whether this shape type has M, and Z values. */
+/* -------------------------------------------------------------------- */
+ if( nSHPType == SHPT_ARCM
+ || nSHPType == SHPT_POINTM
+ || nSHPType == SHPT_POLYGONM
+ || nSHPType == SHPT_MULTIPOINTM )
+ {
+ bHasM = TRUE;
+ bHasZ = FALSE;
+ }
+ else if( nSHPType == SHPT_ARCZ
+ || nSHPType == SHPT_POINTZ
+ || nSHPType == SHPT_POLYGONZ
+ || nSHPType == SHPT_MULTIPOINTZ
+ || nSHPType == SHPT_MULTIPATCH )
+ {
+ bHasM = TRUE;
+ bHasZ = TRUE;
+ }
+ else
+ {
+ bHasM = FALSE;
+ bHasZ = FALSE;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Capture parts. Note that part type is optional, and */
+/* defaults to ring. */
+/* -------------------------------------------------------------------- */
+ if( nSHPType == SHPT_ARC || nSHPType == SHPT_POLYGON
+ || nSHPType == SHPT_ARCM || nSHPType == SHPT_POLYGONM
+ || nSHPType == SHPT_ARCZ || nSHPType == SHPT_POLYGONZ
+ || nSHPType == SHPT_MULTIPATCH )
+ {
+ psObject->nParts = MAX(1,nParts);
+
+ psObject->panPartStart = (int *)
+ malloc(sizeof(int) * psObject->nParts);
+ psObject->panPartType = (int *)
+ malloc(sizeof(int) * psObject->nParts);
+
+ psObject->panPartStart[0] = 0;
+ psObject->panPartType[0] = SHPP_RING;
+
+ for( i = 0; i < nParts; i++ )
+ {
+ psObject->panPartStart[i] = panPartStart[i];
+
+ if( panPartType != NULL )
+ psObject->panPartType[i] = panPartType[i];
+ else
+ psObject->panPartType[i] = SHPP_RING;
+ }
+
+ if( psObject->panPartStart[0] != 0 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_AppDefined,
+ "panPartStart[0] != 0, patching internally. Please fix your code!\n" );
+#else
+ fprintf( stderr, "panPartStart[0] != 0, patching internally. Please fix your code!\n" );
+#endif
+ psObject->panPartStart[0] = 0;
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Capture vertices. Note that Z and M are optional, but X and */
+/* Y are not. */
+/* -------------------------------------------------------------------- */
+ if( nVertices > 0 )
+ {
+ psObject->padfX = (double *) calloc(sizeof(double),nVertices);
+ psObject->padfY = (double *) calloc(sizeof(double),nVertices);
+ psObject->padfZ = (double *) calloc(sizeof(double),nVertices);
+ psObject->padfM = (double *) calloc(sizeof(double),nVertices);
+
+/* RSB 071110 */
+ if ( !(padfX != NULL) ) error("assert( padfX != NULL ) failed");
+ if ( !(padfY != NULL) ) error("assert( padfY != NULL ) failed");
+
+ for( i = 0; i < nVertices; i++ )
+ {
+ psObject->padfX[i] = padfX[i];
+ psObject->padfY[i] = padfY[i];
+ if( padfZ != NULL && bHasZ )
+ psObject->padfZ[i] = padfZ[i];
+ if( padfM != NULL && bHasM )
+ psObject->padfM[i] = padfM[i];
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Compute the extents. */
+/* -------------------------------------------------------------------- */
+ psObject->nVertices = nVertices;
+ SHPComputeExtents( psObject );
+
+ return( psObject );
+}
+
+/************************************************************************/
+/* SHPCreateSimpleObject() */
+/* */
+/* Create a simple (common) shape object. Destroy with */
+/* SHPDestroyObject(). */
+/************************************************************************/
+
+SHPObject SHPAPI_CALL1(*)
+SHPCreateSimpleObject( int nSHPType, int nVertices,
+ const double * padfX, const double * padfY,
+ const double * padfZ )
+
+{
+ return( SHPCreateObject( nSHPType, -1, 0, NULL, NULL,
+ nVertices, padfX, padfY, padfZ, NULL ) );
+}
+
+/************************************************************************/
+/* SHPWriteObject() */
+/* */
+/* Write out the vertices of a new structure. Note that it is */
+/* only possible to write vertices at the end of the file. */
+/************************************************************************/
+
+int SHPAPI_CALL
+SHPWriteObject(SHPHandle psSHP, int nShapeId, SHPObject * psObject )
+
+{
+ int nRecordOffset, i, nRecordSize=0;
+ uchar *pabyRec;
+ int32 i32;
+
+ psSHP->bUpdated = TRUE;
+
+/* -------------------------------------------------------------------- */
+/* Ensure that shape object matches the type of the file it is */
+/* being written to. */
+/* -------------------------------------------------------------------- */
+/* RSB 071110 */
+ if ( !(psObject->nSHPType == psSHP->nShapeType
+ || psObject->nSHPType == SHPT_NULL) ) error("assert( psObject->nSHPType == psSHP->nShapeType || psObject->nSHPType == SHPT_NULL ) failed");
+
+/* -------------------------------------------------------------------- */
+/* Ensure that -1 is used for appends. Either blow an */
+/* assertion, or if they are disabled, set the shapeid to -1 */
+/* for appends. */
+/* -------------------------------------------------------------------- */
+/* RSB 071110 */
+ if ( !(nShapeId == -1
+ || (nShapeId >= 0 && nShapeId < psSHP->nRecords)) ) error("assert( nShapeId == -1 || (nShapeId >= 0 && nShapeId < psSHP->nRecords) ) failed");
+
+ if( nShapeId != -1 && nShapeId >= psSHP->nRecords )
+ nShapeId = -1;
+
+/* -------------------------------------------------------------------- */
+/* Add the new entity to the in memory index. */
+/* -------------------------------------------------------------------- */
+ if( nShapeId == -1 && psSHP->nRecords+1 > psSHP->nMaxRecords )
+ {
+ psSHP->nMaxRecords =(int) ( psSHP->nMaxRecords * 1.3 + 100);
+
+ psSHP->panRecOffset = (int *)
+ SfRealloc(psSHP->panRecOffset,sizeof(int) * psSHP->nMaxRecords );
+ psSHP->panRecSize = (int *)
+ SfRealloc(psSHP->panRecSize,sizeof(int) * psSHP->nMaxRecords );
+ }
+
+/* -------------------------------------------------------------------- */
+/* Initialize record. */
+/* -------------------------------------------------------------------- */
+ pabyRec = (uchar *) malloc(psObject->nVertices * 4 * sizeof(double)
+ + psObject->nParts * 8 + 128);
+
+/* -------------------------------------------------------------------- */
+/* Extract vertices for a Polygon or Arc. */
+/* -------------------------------------------------------------------- */
+ if( psObject->nSHPType == SHPT_POLYGON
+ || psObject->nSHPType == SHPT_POLYGONZ
+ || psObject->nSHPType == SHPT_POLYGONM
+ || psObject->nSHPType == SHPT_ARC
+ || psObject->nSHPType == SHPT_ARCZ
+ || psObject->nSHPType == SHPT_ARCM
+ || psObject->nSHPType == SHPT_MULTIPATCH )
+ {
+ int32 nPoints, nParts;
+ int i;
+
+ nPoints = psObject->nVertices;
+ nParts = psObject->nParts;
+
+ _SHPSetBounds( pabyRec + 12, psObject );
+
+ if( bBigEndian ) SwapWord( 4, &nPoints );
+ if( bBigEndian ) SwapWord( 4, &nParts );
+
+ ByteCopy( &nPoints, pabyRec + 40 + 8, 4 );
+ ByteCopy( &nParts, pabyRec + 36 + 8, 4 );
+
+ nRecordSize = 52;
+
+ /*
+ * Write part start positions.
+ */
+ ByteCopy( psObject->panPartStart, pabyRec + 44 + 8,
+ 4 * psObject->nParts );
+ for( i = 0; i < psObject->nParts; i++ )
+ {
+ if( bBigEndian ) SwapWord( 4, pabyRec + 44 + 8 + 4*i );
+ nRecordSize += 4;
+ }
+
+ /*
+ * Write multipatch part types if needed.
+ */
+ if( psObject->nSHPType == SHPT_MULTIPATCH )
+ {
+ memcpy( pabyRec + nRecordSize, psObject->panPartType,
+ 4*psObject->nParts );
+ for( i = 0; i < psObject->nParts; i++ )
+ {
+ if( bBigEndian ) SwapWord( 4, pabyRec + nRecordSize );
+ nRecordSize += 4;
+ }
+ }
+
+ /*
+ * Write the (x,y) vertex values.
+ */
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ ByteCopy( psObject->padfX + i, pabyRec + nRecordSize, 8 );
+ ByteCopy( psObject->padfY + i, pabyRec + nRecordSize + 8, 8 );
+
+ if( bBigEndian )
+ SwapWord( 8, pabyRec + nRecordSize );
+
+ if( bBigEndian )
+ SwapWord( 8, pabyRec + nRecordSize + 8 );
+
+ nRecordSize += 2 * 8;
+ }
+
+ /*
+ * Write the Z coordinates (if any).
+ */
+ if( psObject->nSHPType == SHPT_POLYGONZ
+ || psObject->nSHPType == SHPT_ARCZ
+ || psObject->nSHPType == SHPT_MULTIPATCH )
+ {
+ ByteCopy( &(psObject->dfZMin), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ ByteCopy( &(psObject->dfZMax), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ ByteCopy( psObject->padfZ + i, pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+ }
+ }
+
+ /*
+ * Write the M values, if any.
+ */
+ if( psObject->nSHPType == SHPT_POLYGONM
+ || psObject->nSHPType == SHPT_ARCM
+#ifndef DISABLE_MULTIPATCH_MEASURE
+ || psObject->nSHPType == SHPT_MULTIPATCH
+#endif
+ || psObject->nSHPType == SHPT_POLYGONZ
+ || psObject->nSHPType == SHPT_ARCZ )
+ {
+ ByteCopy( &(psObject->dfMMin), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ ByteCopy( &(psObject->dfMMax), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ ByteCopy( psObject->padfM + i, pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+ }
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Extract vertices for a MultiPoint. */
+/* -------------------------------------------------------------------- */
+ else if( psObject->nSHPType == SHPT_MULTIPOINT
+ || psObject->nSHPType == SHPT_MULTIPOINTZ
+ || psObject->nSHPType == SHPT_MULTIPOINTM )
+ {
+ int32 nPoints;
+ int i;
+
+ nPoints = psObject->nVertices;
+
+ _SHPSetBounds( pabyRec + 12, psObject );
+
+ if( bBigEndian ) SwapWord( 4, &nPoints );
+ ByteCopy( &nPoints, pabyRec + 44, 4 );
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ ByteCopy( psObject->padfX + i, pabyRec + 48 + i*16, 8 );
+ ByteCopy( psObject->padfY + i, pabyRec + 48 + i*16 + 8, 8 );
+
+ if( bBigEndian ) SwapWord( 8, pabyRec + 48 + i*16 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + 48 + i*16 + 8 );
+ }
+
+ nRecordSize = 48 + 16 * psObject->nVertices;
+
+ if( psObject->nSHPType == SHPT_MULTIPOINTZ )
+ {
+ ByteCopy( &(psObject->dfZMin), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ ByteCopy( &(psObject->dfZMax), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ ByteCopy( psObject->padfZ + i, pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+ }
+ }
+
+ if( psObject->nSHPType == SHPT_MULTIPOINTZ
+ || psObject->nSHPType == SHPT_MULTIPOINTM )
+ {
+ ByteCopy( &(psObject->dfMMin), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ ByteCopy( &(psObject->dfMMax), pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ ByteCopy( psObject->padfM + i, pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+ }
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Write point. */
+/* -------------------------------------------------------------------- */
+ else if( psObject->nSHPType == SHPT_POINT
+ || psObject->nSHPType == SHPT_POINTZ
+ || psObject->nSHPType == SHPT_POINTM )
+ {
+ ByteCopy( psObject->padfX, pabyRec + 12, 8 );
+ ByteCopy( psObject->padfY, pabyRec + 20, 8 );
+
+ if( bBigEndian ) SwapWord( 8, pabyRec + 12 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + 20 );
+
+ nRecordSize = 28;
+
+ if( psObject->nSHPType == SHPT_POINTZ )
+ {
+ ByteCopy( psObject->padfZ, pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+ }
+
+ if( psObject->nSHPType == SHPT_POINTZ
+ || psObject->nSHPType == SHPT_POINTM )
+ {
+ ByteCopy( psObject->padfM, pabyRec + nRecordSize, 8 );
+ if( bBigEndian ) SwapWord( 8, pabyRec + nRecordSize );
+ nRecordSize += 8;
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Not much to do for null geometries. */
+/* -------------------------------------------------------------------- */
+ else if( psObject->nSHPType == SHPT_NULL )
+ {
+ nRecordSize = 12;
+ }
+
+ else
+ {
+ /* unknown type */
+/* RSB 071110 */
+ error("unknown psObject->nSHPType");
+ }
+
+/* -------------------------------------------------------------------- */
+/* Establish where we are going to put this record. If we are */
+/* rewriting and existing record, and it will fit, then put it */
+/* back where the original came from. Otherwise write at the end. */
+/* -------------------------------------------------------------------- */
+ if( nShapeId == -1 || psSHP->panRecSize[nShapeId] < nRecordSize-8 )
+ {
+ if( nShapeId == -1 )
+ nShapeId = psSHP->nRecords++;
+
+ psSHP->panRecOffset[nShapeId] = nRecordOffset = psSHP->nFileSize;
+ psSHP->panRecSize[nShapeId] = nRecordSize-8;
+ psSHP->nFileSize += nRecordSize;
+ }
+ else
+ {
+ nRecordOffset = psSHP->panRecOffset[nShapeId];
+ }
+
+/* -------------------------------------------------------------------- */
+/* Set the shape type, record number, and record size. */
+/* -------------------------------------------------------------------- */
+ i32 = nShapeId+1; /* record # */
+ if( !bBigEndian ) SwapWord( 4, &i32 );
+ ByteCopy( &i32, pabyRec, 4 );
+
+ i32 = (nRecordSize-8)/2; /* record size */
+ if( !bBigEndian ) SwapWord( 4, &i32 );
+ ByteCopy( &i32, pabyRec + 4, 4 );
+
+ i32 = psObject->nSHPType; /* shape type */
+ if( bBigEndian ) SwapWord( 4, &i32 );
+ ByteCopy( &i32, pabyRec + 8, 4 );
+
+/* -------------------------------------------------------------------- */
+/* Write out record. */
+/* -------------------------------------------------------------------- */
+ if( fseek( psSHP->fpSHP, nRecordOffset, 0 ) != 0
+ || fwrite( pabyRec, nRecordSize, 1, psSHP->fpSHP ) < 1 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_FileIO,
+ "Error in fseek() or fwrite() writing object to .shp file." );
+#endif
+ free( pabyRec );
+ return -1;
+ }
+
+ free( pabyRec );
+
+/* -------------------------------------------------------------------- */
+/* Expand file wide bounds based on this shape. */
+/* -------------------------------------------------------------------- */
+ if( psSHP->adBoundsMin[0] == 0.0
+ && psSHP->adBoundsMax[0] == 0.0
+ && psSHP->adBoundsMin[1] == 0.0
+ && psSHP->adBoundsMax[1] == 0.0 )
+ {
+ if( psObject->nSHPType == SHPT_NULL || psObject->nVertices == 0 )
+ {
+ psSHP->adBoundsMin[0] = psSHP->adBoundsMax[0] = 0.0;
+ psSHP->adBoundsMin[1] = psSHP->adBoundsMax[1] = 0.0;
+ psSHP->adBoundsMin[2] = psSHP->adBoundsMax[2] = 0.0;
+ psSHP->adBoundsMin[3] = psSHP->adBoundsMax[3] = 0.0;
+ }
+ else
+ {
+ psSHP->adBoundsMin[0] = psSHP->adBoundsMax[0] = psObject->padfX[0];
+ psSHP->adBoundsMin[1] = psSHP->adBoundsMax[1] = psObject->padfY[0];
+ psSHP->adBoundsMin[2] = psSHP->adBoundsMax[2] = psObject->padfZ[0];
+ psSHP->adBoundsMin[3] = psSHP->adBoundsMax[3] = psObject->padfM[0];
+ }
+ }
+
+ for( i = 0; i < psObject->nVertices; i++ )
+ {
+ psSHP->adBoundsMin[0] = MIN(psSHP->adBoundsMin[0],psObject->padfX[i]);
+ psSHP->adBoundsMin[1] = MIN(psSHP->adBoundsMin[1],psObject->padfY[i]);
+ psSHP->adBoundsMin[2] = MIN(psSHP->adBoundsMin[2],psObject->padfZ[i]);
+ psSHP->adBoundsMin[3] = MIN(psSHP->adBoundsMin[3],psObject->padfM[i]);
+ psSHP->adBoundsMax[0] = MAX(psSHP->adBoundsMax[0],psObject->padfX[i]);
+ psSHP->adBoundsMax[1] = MAX(psSHP->adBoundsMax[1],psObject->padfY[i]);
+ psSHP->adBoundsMax[2] = MAX(psSHP->adBoundsMax[2],psObject->padfZ[i]);
+ psSHP->adBoundsMax[3] = MAX(psSHP->adBoundsMax[3],psObject->padfM[i]);
+ }
+
+ return( nShapeId );
+}
+
+/************************************************************************/
+/* SHPReadObject() */
+/* */
+/* Read the vertices, parts, and other non-attribute information */
+/* for one shape. */
+/************************************************************************/
+
+SHPObject SHPAPI_CALL1(*)
+SHPReadObject( SHPHandle psSHP, int hEntity )
+
+{
+ SHPObject *psShape;
+
+/* -------------------------------------------------------------------- */
+/* Validate the record/entity number. */
+/* -------------------------------------------------------------------- */
+ if( hEntity < 0 || hEntity >= psSHP->nRecords )
+ return( NULL );
+
+/* -------------------------------------------------------------------- */
+/* Ensure our record buffer is large enough. */
+/* -------------------------------------------------------------------- */
+ if( psSHP->panRecSize[hEntity]+8 > psSHP->nBufSize )
+ {
+ psSHP->nBufSize = psSHP->panRecSize[hEntity]+8;
+ psSHP->pabyRec = (uchar *) SfRealloc(psSHP->pabyRec,psSHP->nBufSize);
+ }
+
+/* -------------------------------------------------------------------- */
+/* Read the record. */
+/* -------------------------------------------------------------------- */
+ if( fseek( psSHP->fpSHP, psSHP->panRecOffset[hEntity], 0 ) != 0
+ || fread( psSHP->pabyRec, psSHP->panRecSize[hEntity]+8, 1,
+ psSHP->fpSHP ) != 1 )
+ {
+#ifdef USE_CPL
+ CPLError( CE_Failure, CPLE_FileIO,
+ "Error in fseek() or fread() reading object from .shp file." );
+#endif
+ return NULL;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Allocate and minimally initialize the object. */
+/* -------------------------------------------------------------------- */
+ psShape = (SHPObject *) calloc(1,sizeof(SHPObject));
+ psShape->nShapeId = hEntity;
+
+ memcpy( &psShape->nSHPType, psSHP->pabyRec + 8, 4 );
+ if( bBigEndian ) SwapWord( 4, &(psShape->nSHPType) );
+
+/* ==================================================================== */
+/* Extract vertices for a Polygon or Arc. */
+/* ==================================================================== */
+ if( psShape->nSHPType == SHPT_POLYGON || psShape->nSHPType == SHPT_ARC
+ || psShape->nSHPType == SHPT_POLYGONZ
+ || psShape->nSHPType == SHPT_POLYGONM
+ || psShape->nSHPType == SHPT_ARCZ
+ || psShape->nSHPType == SHPT_ARCM
+ || psShape->nSHPType == SHPT_MULTIPATCH )
+ {
+ int32 nPoints, nParts;
+ int i, nOffset;
+
+/* -------------------------------------------------------------------- */
+/* Get the X/Y bounds. */
+/* -------------------------------------------------------------------- */
+ memcpy( &(psShape->dfXMin), psSHP->pabyRec + 8 + 4, 8 );
+ memcpy( &(psShape->dfYMin), psSHP->pabyRec + 8 + 12, 8 );
+ memcpy( &(psShape->dfXMax), psSHP->pabyRec + 8 + 20, 8 );
+ memcpy( &(psShape->dfYMax), psSHP->pabyRec + 8 + 28, 8 );
+
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfXMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfYMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfXMax) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfYMax) );
+
+/* -------------------------------------------------------------------- */
+/* Extract part/point count, and build vertex and part arrays */
+/* to proper size. */
+/* -------------------------------------------------------------------- */
+ memcpy( &nPoints, psSHP->pabyRec + 40 + 8, 4 );
+ memcpy( &nParts, psSHP->pabyRec + 36 + 8, 4 );
+
+ if( bBigEndian ) SwapWord( 4, &nPoints );
+ if( bBigEndian ) SwapWord( 4, &nParts );
+
+ psShape->nVertices = nPoints;
+ psShape->padfX = (double *) calloc(nPoints,sizeof(double));
+ psShape->padfY = (double *) calloc(nPoints,sizeof(double));
+ psShape->padfZ = (double *) calloc(nPoints,sizeof(double));
+ psShape->padfM = (double *) calloc(nPoints,sizeof(double));
+
+ psShape->nParts = nParts;
+ psShape->panPartStart = (int *) calloc(nParts,sizeof(int));
+ psShape->panPartType = (int *) calloc(nParts,sizeof(int));
+
+ for( i = 0; i < nParts; i++ )
+ psShape->panPartType[i] = SHPP_RING;
+
+/* -------------------------------------------------------------------- */
+/* Copy out the part array from the record. */
+/* -------------------------------------------------------------------- */
+ memcpy( psShape->panPartStart, psSHP->pabyRec + 44 + 8, 4 * nParts );
+ for( i = 0; i < nParts; i++ )
+ {
+ if( bBigEndian ) SwapWord( 4, psShape->panPartStart+i );
+ }
+
+ nOffset = 44 + 8 + 4*nParts;
+
+/* -------------------------------------------------------------------- */
+/* If this is a multipatch, we will also have parts types. */
+/* -------------------------------------------------------------------- */
+ if( psShape->nSHPType == SHPT_MULTIPATCH )
+ {
+ memcpy( psShape->panPartType, psSHP->pabyRec + nOffset, 4*nParts );
+ for( i = 0; i < nParts; i++ )
+ {
+ if( bBigEndian ) SwapWord( 4, psShape->panPartType+i );
+ }
+
+ nOffset += 4*nParts;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Copy out the vertices from the record. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < nPoints; i++ )
+ {
+ memcpy(psShape->padfX + i,
+ psSHP->pabyRec + nOffset + i * 16,
+ 8 );
+
+ memcpy(psShape->padfY + i,
+ psSHP->pabyRec + nOffset + i * 16 + 8,
+ 8 );
+
+ if( bBigEndian ) SwapWord( 8, psShape->padfX + i );
+ if( bBigEndian ) SwapWord( 8, psShape->padfY + i );
+ }
+
+ nOffset += 16*nPoints;
+
+/* -------------------------------------------------------------------- */
+/* If we have a Z coordinate, collect that now. */
+/* -------------------------------------------------------------------- */
+ if( psShape->nSHPType == SHPT_POLYGONZ
+ || psShape->nSHPType == SHPT_ARCZ
+ || psShape->nSHPType == SHPT_MULTIPATCH )
+ {
+ memcpy( &(psShape->dfZMin), psSHP->pabyRec + nOffset, 8 );
+ memcpy( &(psShape->dfZMax), psSHP->pabyRec + nOffset + 8, 8 );
+
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfZMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfZMax) );
+
+ for( i = 0; i < nPoints; i++ )
+ {
+ memcpy( psShape->padfZ + i,
+ psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+ if( bBigEndian ) SwapWord( 8, psShape->padfZ + i );
+ }
+
+ nOffset += 16 + 8*nPoints;
+ }
+
+/* -------------------------------------------------------------------- */
+/* If we have a M measure value, then read it now. We assume */
+/* that the measure can be present for any shape if the size is */
+/* big enough, but really it will only occur for the Z shapes */
+/* (options), and the M shapes. */
+/* -------------------------------------------------------------------- */
+ if( psSHP->panRecSize[hEntity]+8 >= nOffset + 16 + 8*nPoints )
+ {
+ memcpy( &(psShape->dfMMin), psSHP->pabyRec + nOffset, 8 );
+ memcpy( &(psShape->dfMMax), psSHP->pabyRec + nOffset + 8, 8 );
+
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfMMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfMMax) );
+
+ for( i = 0; i < nPoints; i++ )
+ {
+ memcpy( psShape->padfM + i,
+ psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+ if( bBigEndian ) SwapWord( 8, psShape->padfM + i );
+ }
+ }
+
+ }
+
+/* ==================================================================== */
+/* Extract vertices for a MultiPoint. */
+/* ==================================================================== */
+ else if( psShape->nSHPType == SHPT_MULTIPOINT
+ || psShape->nSHPType == SHPT_MULTIPOINTM
+ || psShape->nSHPType == SHPT_MULTIPOINTZ )
+ {
+ int32 nPoints;
+ int i, nOffset;
+
+ memcpy( &nPoints, psSHP->pabyRec + 44, 4 );
+ if( bBigEndian ) SwapWord( 4, &nPoints );
+
+ psShape->nVertices = nPoints;
+ psShape->padfX = (double *) calloc(nPoints,sizeof(double));
+ psShape->padfY = (double *) calloc(nPoints,sizeof(double));
+ psShape->padfZ = (double *) calloc(nPoints,sizeof(double));
+ psShape->padfM = (double *) calloc(nPoints,sizeof(double));
+
+ for( i = 0; i < nPoints; i++ )
+ {
+ memcpy(psShape->padfX+i, psSHP->pabyRec + 48 + 16 * i, 8 );
+ memcpy(psShape->padfY+i, psSHP->pabyRec + 48 + 16 * i + 8, 8 );
+
+ if( bBigEndian ) SwapWord( 8, psShape->padfX + i );
+ if( bBigEndian ) SwapWord( 8, psShape->padfY + i );
+ }
+
+ nOffset = 48 + 16*nPoints;
+
+/* -------------------------------------------------------------------- */
+/* Get the X/Y bounds. */
+/* -------------------------------------------------------------------- */
+ memcpy( &(psShape->dfXMin), psSHP->pabyRec + 8 + 4, 8 );
+ memcpy( &(psShape->dfYMin), psSHP->pabyRec + 8 + 12, 8 );
+ memcpy( &(psShape->dfXMax), psSHP->pabyRec + 8 + 20, 8 );
+ memcpy( &(psShape->dfYMax), psSHP->pabyRec + 8 + 28, 8 );
+
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfXMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfYMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfXMax) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfYMax) );
+
+/* -------------------------------------------------------------------- */
+/* If we have a Z coordinate, collect that now. */
+/* -------------------------------------------------------------------- */
+ if( psShape->nSHPType == SHPT_MULTIPOINTZ )
+ {
+ memcpy( &(psShape->dfZMin), psSHP->pabyRec + nOffset, 8 );
+ memcpy( &(psShape->dfZMax), psSHP->pabyRec + nOffset + 8, 8 );
+
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfZMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfZMax) );
+
+ for( i = 0; i < nPoints; i++ )
+ {
+ memcpy( psShape->padfZ + i,
+ psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+ if( bBigEndian ) SwapWord( 8, psShape->padfZ + i );
+ }
+
+ nOffset += 16 + 8*nPoints;
+ }
+
+/* -------------------------------------------------------------------- */
+/* If we have a M measure value, then read it now. We assume */
+/* that the measure can be present for any shape if the size is */
+/* big enough, but really it will only occur for the Z shapes */
+/* (options), and the M shapes. */
+/* -------------------------------------------------------------------- */
+ if( psSHP->panRecSize[hEntity]+8 >= nOffset + 16 + 8*nPoints )
+ {
+ memcpy( &(psShape->dfMMin), psSHP->pabyRec + nOffset, 8 );
+ memcpy( &(psShape->dfMMax), psSHP->pabyRec + nOffset + 8, 8 );
+
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfMMin) );
+ if( bBigEndian ) SwapWord( 8, &(psShape->dfMMax) );
+
+ for( i = 0; i < nPoints; i++ )
+ {
+ memcpy( psShape->padfM + i,
+ psSHP->pabyRec + nOffset + 16 + i*8, 8 );
+ if( bBigEndian ) SwapWord( 8, psShape->padfM + i );
+ }
+ }
+ }
+
+/* ==================================================================== */
+/* Extract vertices for a point. */
+/* ==================================================================== */
+ else if( psShape->nSHPType == SHPT_POINT
+ || psShape->nSHPType == SHPT_POINTM
+ || psShape->nSHPType == SHPT_POINTZ )
+ {
+ int nOffset;
+
+ psShape->nVertices = 1;
+ psShape->padfX = (double *) calloc(1,sizeof(double));
+ psShape->padfY = (double *) calloc(1,sizeof(double));
+ psShape->padfZ = (double *) calloc(1,sizeof(double));
+ psShape->padfM = (double *) calloc(1,sizeof(double));
+
+ memcpy( psShape->padfX, psSHP->pabyRec + 12, 8 );
+ memcpy( psShape->padfY, psSHP->pabyRec + 20, 8 );
+
+ if( bBigEndian ) SwapWord( 8, psShape->padfX );
+ if( bBigEndian ) SwapWord( 8, psShape->padfY );
+
+ nOffset = 20 + 8;
+
+/* -------------------------------------------------------------------- */
+/* If we have a Z coordinate, collect that now. */
+/* -------------------------------------------------------------------- */
+ if( psShape->nSHPType == SHPT_POINTZ )
+ {
+ memcpy( psShape->padfZ, psSHP->pabyRec + nOffset, 8 );
+
+ if( bBigEndian ) SwapWord( 8, psShape->padfZ );
+
+ nOffset += 8;
+ }
+
+/* -------------------------------------------------------------------- */
+/* If we have a M measure value, then read it now. We assume */
+/* that the measure can be present for any shape if the size is */
+/* big enough, but really it will only occur for the Z shapes */
+/* (options), and the M shapes. */
+/* -------------------------------------------------------------------- */
+ if( psSHP->panRecSize[hEntity]+8 >= nOffset + 8 )
+ {
+ memcpy( psShape->padfM, psSHP->pabyRec + nOffset, 8 );
+
+ if( bBigEndian ) SwapWord( 8, psShape->padfM );
+ }
+
+/* -------------------------------------------------------------------- */
+/* Since no extents are supplied in the record, we will apply */
+/* them from the single vertex. */
+/* -------------------------------------------------------------------- */
+ psShape->dfXMin = psShape->dfXMax = psShape->padfX[0];
+ psShape->dfYMin = psShape->dfYMax = psShape->padfY[0];
+ psShape->dfZMin = psShape->dfZMax = psShape->padfZ[0];
+ psShape->dfMMin = psShape->dfMMax = psShape->padfM[0];
+ }
+
+ return( psShape );
+}
+
+/************************************************************************/
+/* SHPTypeName() */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+SHPTypeName( int nSHPType )
+
+{
+ switch( nSHPType )
+ {
+ case SHPT_NULL:
+ return "NullShape";
+
+ case SHPT_POINT:
+ return "Point";
+
+ case SHPT_ARC:
+ return "Arc";
+
+ case SHPT_POLYGON:
+ return "Polygon";
+
+ case SHPT_MULTIPOINT:
+ return "MultiPoint";
+
+ case SHPT_POINTZ:
+ return "PointZ";
+
+ case SHPT_ARCZ:
+ return "ArcZ";
+
+ case SHPT_POLYGONZ:
+ return "PolygonZ";
+
+ case SHPT_MULTIPOINTZ:
+ return "MultiPointZ";
+
+ case SHPT_POINTM:
+ return "PointM";
+
+ case SHPT_ARCM:
+ return "ArcM";
+
+ case SHPT_POLYGONM:
+ return "PolygonM";
+
+ case SHPT_MULTIPOINTM:
+ return "MultiPointM";
+
+ case SHPT_MULTIPATCH:
+ return "MultiPatch";
+
+ default:
+ return "UnknownShapeType";
+ }
+}
+
+/************************************************************************/
+/* SHPPartTypeName() */
+/************************************************************************/
+
+const char SHPAPI_CALL1(*)
+SHPPartTypeName( int nPartType )
+
+{
+ switch( nPartType )
+ {
+ case SHPP_TRISTRIP:
+ return "TriangleStrip";
+
+ case SHPP_TRIFAN:
+ return "TriangleFan";
+
+ case SHPP_OUTERRING:
+ return "OuterRing";
+
+ case SHPP_INNERRING:
+ return "InnerRing";
+
+ case SHPP_FIRSTRING:
+ return "FirstRing";
+
+ case SHPP_RING:
+ return "Ring";
+
+ default:
+ return "UnknownPartType";
+ }
+}
+
+/************************************************************************/
+/* SHPDestroyObject() */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPDestroyObject( SHPObject * psShape )
+
+{
+ if( psShape == NULL )
+ return;
+
+ if( psShape->padfX != NULL )
+ free( psShape->padfX );
+ if( psShape->padfY != NULL )
+ free( psShape->padfY );
+ if( psShape->padfZ != NULL )
+ free( psShape->padfZ );
+ if( psShape->padfM != NULL )
+ free( psShape->padfM );
+
+ if( psShape->panPartStart != NULL )
+ free( psShape->panPartStart );
+ if( psShape->panPartType != NULL )
+ free( psShape->panPartType );
+
+ free( psShape );
+}
+
+/************************************************************************/
+/* SHPRewindObject() */
+/* */
+/* Reset the winding of polygon objects to adhere to the */
+/* specification. */
+/************************************************************************/
+
+int SHPAPI_CALL
+SHPRewindObject( SHPHandle hSHP, SHPObject * psObject )
+
+{
+ int iOpRing, bAltered = 0;
+
+/* -------------------------------------------------------------------- */
+/* Do nothing if this is not a polygon object. */
+/* -------------------------------------------------------------------- */
+ if( psObject->nSHPType != SHPT_POLYGON
+ && psObject->nSHPType != SHPT_POLYGONZ
+ && psObject->nSHPType != SHPT_POLYGONM )
+ return 0;
+
+ if( psObject->nVertices == 0 || psObject->nParts == 0 )
+ return 0;
+
+/* -------------------------------------------------------------------- */
+/* Process each of the rings. */
+/* -------------------------------------------------------------------- */
+ for( iOpRing = 0; iOpRing < psObject->nParts; iOpRing++ )
+ {
+ int bInner, iVert, nVertCount, nVertStart, iCheckRing;
+ double dfSum, dfTestX, dfTestY;
+
+/* -------------------------------------------------------------------- */
+/* Determine if this ring is an inner ring or an outer ring */
+/* relative to all the other rings. For now we assume the */
+/* first ring is outer and all others are inner, but eventually */
+/* we need to fix this to handle multiple island polygons and */
+/* unordered sets of rings. */
+/* -------------------------------------------------------------------- */
+ dfTestX = psObject->padfX[psObject->panPartStart[iOpRing]];
+ dfTestY = psObject->padfY[psObject->panPartStart[iOpRing]];
+
+ bInner = FALSE;
+ for( iCheckRing = 0; iCheckRing < psObject->nParts; iCheckRing++ )
+ {
+ int iEdge;
+
+ if( iCheckRing == iOpRing )
+ continue;
+
+ nVertStart = psObject->panPartStart[iCheckRing];
+
+ if( iCheckRing == psObject->nParts-1 )
+ nVertCount = psObject->nVertices
+ - psObject->panPartStart[iCheckRing];
+ else
+ nVertCount = psObject->panPartStart[iCheckRing+1]
+ - psObject->panPartStart[iCheckRing];
+
+ for( iEdge = 0; iEdge < nVertCount; iEdge++ )
+ {
+ int iNext;
+
+ if( iEdge < nVertCount-1 )
+ iNext = iEdge+1;
+ else
+ iNext = 0;
+
+ if( (psObject->padfY[iEdge+nVertStart] < dfTestY
+ && psObject->padfY[iNext+nVertStart] >= dfTestY)
+ || (psObject->padfY[iNext+nVertStart] < dfTestY
+ && psObject->padfY[iEdge+nVertStart] >= dfTestY) )
+ {
+ if( psObject->padfX[iEdge+nVertStart]
+ + (dfTestY - psObject->padfY[iEdge+nVertStart])
+ / (psObject->padfY[iNext+nVertStart]
+ - psObject->padfY[iEdge+nVertStart])
+ * (psObject->padfX[iNext+nVertStart]
+ - psObject->padfX[iEdge+nVertStart]) < dfTestX )
+ bInner = !bInner;
+ }
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Determine the current order of this ring so we will know if */
+/* it has to be reversed. */
+/* -------------------------------------------------------------------- */
+ nVertStart = psObject->panPartStart[iOpRing];
+
+ if( iOpRing == psObject->nParts-1 )
+ nVertCount = psObject->nVertices - psObject->panPartStart[iOpRing];
+ else
+ nVertCount = psObject->panPartStart[iOpRing+1]
+ - psObject->panPartStart[iOpRing];
+
+ dfSum = 0.0;
+ for( iVert = nVertStart; iVert < nVertStart+nVertCount-1; iVert++ )
+ {
+ dfSum += psObject->padfX[iVert] * psObject->padfY[iVert+1]
+ - psObject->padfY[iVert] * psObject->padfX[iVert+1];
+ }
+
+ dfSum += psObject->padfX[iVert] * psObject->padfY[nVertStart]
+ - psObject->padfY[iVert] * psObject->padfX[nVertStart];
+
+/* -------------------------------------------------------------------- */
+/* Reverse if necessary. */
+/* -------------------------------------------------------------------- */
+ if( (dfSum < 0.0 && bInner) || (dfSum > 0.0 && !bInner) )
+ {
+ int i;
+
+ bAltered++;
+ for( i = 0; i < nVertCount/2; i++ )
+ {
+ double dfSaved;
+
+ /* Swap X */
+ dfSaved = psObject->padfX[nVertStart+i];
+ psObject->padfX[nVertStart+i] =
+ psObject->padfX[nVertStart+nVertCount-i-1];
+ psObject->padfX[nVertStart+nVertCount-i-1] = dfSaved;
+
+ /* Swap Y */
+ dfSaved = psObject->padfY[nVertStart+i];
+ psObject->padfY[nVertStart+i] =
+ psObject->padfY[nVertStart+nVertCount-i-1];
+ psObject->padfY[nVertStart+nVertCount-i-1] = dfSaved;
+
+ /* Swap Z */
+ if( psObject->padfZ )
+ {
+ dfSaved = psObject->padfZ[nVertStart+i];
+ psObject->padfZ[nVertStart+i] =
+ psObject->padfZ[nVertStart+nVertCount-i-1];
+ psObject->padfZ[nVertStart+nVertCount-i-1] = dfSaved;
+ }
+
+ /* Swap M */
+ if( psObject->padfM )
+ {
+ dfSaved = psObject->padfM[nVertStart+i];
+ psObject->padfM[nVertStart+i] =
+ psObject->padfM[nVertStart+nVertCount-i-1];
+ psObject->padfM[nVertStart+nVertCount-i-1] = dfSaved;
+ }
+ }
+ }
+ }
+
+ return bAltered;
+}
diff --git a/src/shptree.c b/src/shptree.c
new file mode 100644
index 0000000..a1a2e83
--- /dev/null
+++ b/src/shptree.c
@@ -0,0 +1,986 @@
+/******************************************************************************
+ * $Id: shptree.c,v 1.2 2007/11/10 13:17:42 rsbivand Exp $
+ *
+ * Project: Shapelib
+ * Purpose: Implementation of quadtree building and searching functions.
+ * Author: Frank Warmerdam, warmerdam at pobox.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * This software is available under the following "MIT Style" license,
+ * or at the option of the licensee under the LGPL (see LICENSE.LGPL). This
+ * option is discussed in more detail in shapelib.html.
+ *
+ * --
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: shptree.c,v $
+ * Revision 1.2 2007/11/10 13:17:42 rsbivand
+ * assert
+ *
+ * Revision 1.1.1.1 2005/09/01 18:22:22 rsbivand
+ * Initial import.
+ *
+ * Revision 1.10 2005/01/03 22:30:13 fwarmerdam
+ * added support for saved quadtrees
+ *
+ * Revision 1.9 2003/01/28 15:53:41 warmerda
+ * Avoid build warnings.
+ *
+ * Revision 1.8 2002/05/07 13:07:45 warmerda
+ * use qsort() - patch from Bernhard Herzog
+ *
+ * Revision 1.7 2002/01/15 14:36:07 warmerda
+ * updated email address
+ *
+ * Revision 1.6 2001/05/23 13:36:52 warmerda
+ * added use of SHPAPI_CALL
+ *
+ * Revision 1.5 1999/11/05 14:12:05 warmerda
+ * updated license terms
+ *
+ * Revision 1.4 1999/06/02 18:24:21 warmerda
+ * added trimming code
+ *
+ * Revision 1.3 1999/06/02 17:56:12 warmerda
+ * added quad'' subnode support for trees
+ *
+ * Revision 1.2 1999/05/18 19:11:11 warmerda
+ * Added example searching capability
+ *
+ * Revision 1.1 1999/05/18 17:49:20 warmerda
+ * New
+ *
+ */
+
+#include "shapefil.h"
+
+#include <math.h>
+/* #include <assert.h> RSB 071110 */
+#include <stdlib.h>
+#include <string.h>
+
+SHP_CVSID("$Id: shptree.c,v 1.2 2007/11/10 13:17:42 rsbivand Exp $")
+
+#ifndef TRUE
+# define TRUE 1
+# define FALSE 0
+#endif
+
+static int bBigEndian = 0;
+
+
+/* -------------------------------------------------------------------- */
+/* If the following is 0.5, nodes will be split in half. If it */
+/* is 0.6 then each subnode will contain 60% of the parent */
+/* node, with 20% representing overlap. This can be help to */
+/* prevent small objects on a boundary from shifting too high */
+/* up the tree. */
+/* -------------------------------------------------------------------- */
+
+#define SHP_SPLIT_RATIO 0.55
+
+/************************************************************************/
+/* SfRealloc() */
+/* */
+/* A realloc cover function that will access a NULL pointer as */
+/* a valid input. */
+/************************************************************************/
+
+static void * SfRealloc( void * pMem, int nNewSize )
+
+{
+ if( pMem == NULL )
+ return( (void *) malloc(nNewSize) );
+ else
+ return( (void *) realloc(pMem,nNewSize) );
+}
+
+/************************************************************************/
+/* SHPTreeNodeInit() */
+/* */
+/* Initialize a tree node. */
+/************************************************************************/
+
+static SHPTreeNode *SHPTreeNodeCreate( double * padfBoundsMin,
+ double * padfBoundsMax )
+
+{
+ SHPTreeNode *psTreeNode;
+
+ psTreeNode = (SHPTreeNode *) malloc(sizeof(SHPTreeNode));
+
+ psTreeNode->nShapeCount = 0;
+ psTreeNode->panShapeIds = NULL;
+ psTreeNode->papsShapeObj = NULL;
+
+ psTreeNode->nSubNodes = 0;
+
+ if( padfBoundsMin != NULL )
+ memcpy( psTreeNode->adfBoundsMin, padfBoundsMin, sizeof(double) * 4 );
+
+ if( padfBoundsMax != NULL )
+ memcpy( psTreeNode->adfBoundsMax, padfBoundsMax, sizeof(double) * 4 );
+
+ return psTreeNode;
+}
+
+
+/************************************************************************/
+/* SHPCreateTree() */
+/************************************************************************/
+
+SHPTree SHPAPI_CALL1(*)
+SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth,
+ double *padfBoundsMin, double *padfBoundsMax )
+
+{
+ SHPTree *psTree;
+
+ if( padfBoundsMin == NULL && hSHP == NULL )
+ return NULL;
+
+/* -------------------------------------------------------------------- */
+/* Allocate the tree object */
+/* -------------------------------------------------------------------- */
+ psTree = (SHPTree *) malloc(sizeof(SHPTree));
+
+ psTree->hSHP = hSHP;
+ psTree->nMaxDepth = nMaxDepth;
+ psTree->nDimension = nDimension;
+ psTree->nTotalCount = 0;
+
+/* -------------------------------------------------------------------- */
+/* If no max depth was defined, try to select a reasonable one */
+/* that implies approximately 8 shapes per node. */
+/* -------------------------------------------------------------------- */
+ if( psTree->nMaxDepth == 0 && hSHP != NULL )
+ {
+ int nMaxNodeCount = 1;
+ int nShapeCount;
+
+ SHPGetInfo( hSHP, &nShapeCount, NULL, NULL, NULL );
+ while( nMaxNodeCount*4 < nShapeCount )
+ {
+ psTree->nMaxDepth += 1;
+ nMaxNodeCount = nMaxNodeCount * 2;
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Allocate the root node. */
+/* -------------------------------------------------------------------- */
+ psTree->psRoot = SHPTreeNodeCreate( padfBoundsMin, padfBoundsMax );
+
+/* -------------------------------------------------------------------- */
+/* Assign the bounds to the root node. If none are passed in, */
+/* use the bounds of the provided file otherwise the create */
+/* function will have already set the bounds. */
+/* -------------------------------------------------------------------- */
+ if( padfBoundsMin == NULL )
+ {
+ SHPGetInfo( hSHP, NULL, NULL,
+ psTree->psRoot->adfBoundsMin,
+ psTree->psRoot->adfBoundsMax );
+ }
+
+/* -------------------------------------------------------------------- */
+/* If we have a file, insert all it's shapes into the tree. */
+/* -------------------------------------------------------------------- */
+ if( hSHP != NULL )
+ {
+ int iShape, nShapeCount;
+
+ SHPGetInfo( hSHP, &nShapeCount, NULL, NULL, NULL );
+
+ for( iShape = 0; iShape < nShapeCount; iShape++ )
+ {
+ SHPObject *psShape;
+
+ psShape = SHPReadObject( hSHP, iShape );
+ SHPTreeAddShapeId( psTree, psShape );
+ SHPDestroyObject( psShape );
+ }
+ }
+
+ return psTree;
+}
+
+/************************************************************************/
+/* SHPDestroyTreeNode() */
+/************************************************************************/
+
+static void SHPDestroyTreeNode( SHPTreeNode * psTreeNode )
+
+{
+ int i;
+
+ for( i = 0; i < psTreeNode->nSubNodes; i++ )
+ {
+ if( psTreeNode->apsSubNode[i] != NULL )
+ SHPDestroyTreeNode( psTreeNode->apsSubNode[i] );
+ }
+
+ if( psTreeNode->panShapeIds != NULL )
+ free( psTreeNode->panShapeIds );
+
+ if( psTreeNode->papsShapeObj != NULL )
+ {
+ for( i = 0; i < psTreeNode->nShapeCount; i++ )
+ {
+ if( psTreeNode->papsShapeObj[i] != NULL )
+ SHPDestroyObject( psTreeNode->papsShapeObj[i] );
+ }
+
+ free( psTreeNode->papsShapeObj );
+ }
+
+ free( psTreeNode );
+}
+
+/************************************************************************/
+/* SHPDestroyTree() */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPDestroyTree( SHPTree * psTree )
+
+{
+ SHPDestroyTreeNode( psTree->psRoot );
+ free( psTree );
+}
+
+/************************************************************************/
+/* SHPCheckBoundsOverlap() */
+/* */
+/* Do the given boxes overlap at all? */
+/************************************************************************/
+
+int SHPAPI_CALL
+SHPCheckBoundsOverlap( double * padfBox1Min, double * padfBox1Max,
+ double * padfBox2Min, double * padfBox2Max,
+ int nDimension )
+
+{
+ int iDim;
+
+ for( iDim = 0; iDim < nDimension; iDim++ )
+ {
+ if( padfBox2Max[iDim] < padfBox1Min[iDim] )
+ return FALSE;
+
+ if( padfBox1Max[iDim] < padfBox2Min[iDim] )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/************************************************************************/
+/* SHPCheckObjectContained() */
+/* */
+/* Does the given shape fit within the indicated extents? */
+/************************************************************************/
+
+static int SHPCheckObjectContained( SHPObject * psObject, int nDimension,
+ double * padfBoundsMin, double * padfBoundsMax )
+
+{
+ if( psObject->dfXMin < padfBoundsMin[0]
+ || psObject->dfXMax > padfBoundsMax[0] )
+ return FALSE;
+
+ if( psObject->dfYMin < padfBoundsMin[1]
+ || psObject->dfYMax > padfBoundsMax[1] )
+ return FALSE;
+
+ if( nDimension == 2 )
+ return TRUE;
+
+ if( psObject->dfZMin < padfBoundsMin[2]
+ || psObject->dfZMax < padfBoundsMax[2] )
+ return FALSE;
+
+ if( nDimension == 3 )
+ return TRUE;
+
+ if( psObject->dfMMin < padfBoundsMin[3]
+ || psObject->dfMMax < padfBoundsMax[3] )
+ return FALSE;
+
+ return TRUE;
+}
+
+/************************************************************************/
+/* SHPTreeSplitBounds() */
+/* */
+/* Split a region into two subregion evenly, cutting along the */
+/* longest dimension. */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPTreeSplitBounds( double *padfBoundsMinIn, double *padfBoundsMaxIn,
+ double *padfBoundsMin1, double * padfBoundsMax1,
+ double *padfBoundsMin2, double * padfBoundsMax2 )
+
+{
+/* -------------------------------------------------------------------- */
+/* The output bounds will be very similar to the input bounds, */
+/* so just copy over to start. */
+/* -------------------------------------------------------------------- */
+ memcpy( padfBoundsMin1, padfBoundsMinIn, sizeof(double) * 4 );
+ memcpy( padfBoundsMax1, padfBoundsMaxIn, sizeof(double) * 4 );
+ memcpy( padfBoundsMin2, padfBoundsMinIn, sizeof(double) * 4 );
+ memcpy( padfBoundsMax2, padfBoundsMaxIn, sizeof(double) * 4 );
+
+/* -------------------------------------------------------------------- */
+/* Split in X direction. */
+/* -------------------------------------------------------------------- */
+ if( (padfBoundsMaxIn[0] - padfBoundsMinIn[0])
+ > (padfBoundsMaxIn[1] - padfBoundsMinIn[1]) )
+ {
+ double dfRange = padfBoundsMaxIn[0] - padfBoundsMinIn[0];
+
+ padfBoundsMax1[0] = padfBoundsMinIn[0] + dfRange * SHP_SPLIT_RATIO;
+ padfBoundsMin2[0] = padfBoundsMaxIn[0] - dfRange * SHP_SPLIT_RATIO;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Otherwise split in Y direction. */
+/* -------------------------------------------------------------------- */
+ else
+ {
+ double dfRange = padfBoundsMaxIn[1] - padfBoundsMinIn[1];
+
+ padfBoundsMax1[1] = padfBoundsMinIn[1] + dfRange * SHP_SPLIT_RATIO;
+ padfBoundsMin2[1] = padfBoundsMaxIn[1] - dfRange * SHP_SPLIT_RATIO;
+ }
+}
+
+/************************************************************************/
+/* SHPTreeNodeAddShapeId() */
+/************************************************************************/
+
+static int
+SHPTreeNodeAddShapeId( SHPTreeNode * psTreeNode, SHPObject * psObject,
+ int nMaxDepth, int nDimension )
+
+{
+ int i;
+
+/* -------------------------------------------------------------------- */
+/* If there are subnodes, then consider wiether this object */
+/* will fit in them. */
+/* -------------------------------------------------------------------- */
+ if( nMaxDepth > 1 && psTreeNode->nSubNodes > 0 )
+ {
+ for( i = 0; i < psTreeNode->nSubNodes; i++ )
+ {
+ if( SHPCheckObjectContained(psObject, nDimension,
+ psTreeNode->apsSubNode[i]->adfBoundsMin,
+ psTreeNode->apsSubNode[i]->adfBoundsMax))
+ {
+ return SHPTreeNodeAddShapeId( psTreeNode->apsSubNode[i],
+ psObject, nMaxDepth-1,
+ nDimension );
+ }
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* Otherwise, consider creating four subnodes if could fit into */
+/* them, and adding to the appropriate subnode. */
+/* -------------------------------------------------------------------- */
+#if MAX_SUBNODE == 4
+ else if( nMaxDepth > 1 && psTreeNode->nSubNodes == 0 )
+ {
+ double adfBoundsMinH1[4], adfBoundsMaxH1[4];
+ double adfBoundsMinH2[4], adfBoundsMaxH2[4];
+ double adfBoundsMin1[4], adfBoundsMax1[4];
+ double adfBoundsMin2[4], adfBoundsMax2[4];
+ double adfBoundsMin3[4], adfBoundsMax3[4];
+ double adfBoundsMin4[4], adfBoundsMax4[4];
+
+ SHPTreeSplitBounds( psTreeNode->adfBoundsMin,
+ psTreeNode->adfBoundsMax,
+ adfBoundsMinH1, adfBoundsMaxH1,
+ adfBoundsMinH2, adfBoundsMaxH2 );
+
+ SHPTreeSplitBounds( adfBoundsMinH1, adfBoundsMaxH1,
+ adfBoundsMin1, adfBoundsMax1,
+ adfBoundsMin2, adfBoundsMax2 );
+
+ SHPTreeSplitBounds( adfBoundsMinH2, adfBoundsMaxH2,
+ adfBoundsMin3, adfBoundsMax3,
+ adfBoundsMin4, adfBoundsMax4 );
+
+ if( SHPCheckObjectContained(psObject, nDimension,
+ adfBoundsMin1, adfBoundsMax1)
+ || SHPCheckObjectContained(psObject, nDimension,
+ adfBoundsMin2, adfBoundsMax2)
+ || SHPCheckObjectContained(psObject, nDimension,
+ adfBoundsMin3, adfBoundsMax3)
+ || SHPCheckObjectContained(psObject, nDimension,
+ adfBoundsMin4, adfBoundsMax4) )
+ {
+ psTreeNode->nSubNodes = 4;
+ psTreeNode->apsSubNode[0] = SHPTreeNodeCreate( adfBoundsMin1,
+ adfBoundsMax1 );
+ psTreeNode->apsSubNode[1] = SHPTreeNodeCreate( adfBoundsMin2,
+ adfBoundsMax2 );
+ psTreeNode->apsSubNode[2] = SHPTreeNodeCreate( adfBoundsMin3,
+ adfBoundsMax3 );
+ psTreeNode->apsSubNode[3] = SHPTreeNodeCreate( adfBoundsMin4,
+ adfBoundsMax4 );
+
+ /* recurse back on this node now that it has subnodes */
+ return( SHPTreeNodeAddShapeId( psTreeNode, psObject,
+ nMaxDepth, nDimension ) );
+ }
+ }
+#endif /* MAX_SUBNODE == 4 */
+
+/* -------------------------------------------------------------------- */
+/* Otherwise, consider creating two subnodes if could fit into */
+/* them, and adding to the appropriate subnode. */
+/* -------------------------------------------------------------------- */
+#if MAX_SUBNODE == 2
+ else if( nMaxDepth > 1 && psTreeNode->nSubNodes == 0 )
+ {
+ double adfBoundsMin1[4], adfBoundsMax1[4];
+ double adfBoundsMin2[4], adfBoundsMax2[4];
+
+ SHPTreeSplitBounds( psTreeNode->adfBoundsMin, psTreeNode->adfBoundsMax,
+ adfBoundsMin1, adfBoundsMax1,
+ adfBoundsMin2, adfBoundsMax2 );
+
+ if( SHPCheckObjectContained(psObject, nDimension,
+ adfBoundsMin1, adfBoundsMax1))
+ {
+ psTreeNode->nSubNodes = 2;
+ psTreeNode->apsSubNode[0] = SHPTreeNodeCreate( adfBoundsMin1,
+ adfBoundsMax1 );
+ psTreeNode->apsSubNode[1] = SHPTreeNodeCreate( adfBoundsMin2,
+ adfBoundsMax2 );
+
+ return( SHPTreeNodeAddShapeId( psTreeNode->apsSubNode[0], psObject,
+ nMaxDepth - 1, nDimension ) );
+ }
+ else if( SHPCheckObjectContained(psObject, nDimension,
+ adfBoundsMin2, adfBoundsMax2) )
+ {
+ psTreeNode->nSubNodes = 2;
+ psTreeNode->apsSubNode[0] = SHPTreeNodeCreate( adfBoundsMin1,
+ adfBoundsMax1 );
+ psTreeNode->apsSubNode[1] = SHPTreeNodeCreate( adfBoundsMin2,
+ adfBoundsMax2 );
+
+ return( SHPTreeNodeAddShapeId( psTreeNode->apsSubNode[1], psObject,
+ nMaxDepth - 1, nDimension ) );
+ }
+ }
+#endif /* MAX_SUBNODE == 2 */
+
+/* -------------------------------------------------------------------- */
+/* If none of that worked, just add it to this nodes list. */
+/* -------------------------------------------------------------------- */
+ psTreeNode->nShapeCount++;
+
+ psTreeNode->panShapeIds = (int *)
+ SfRealloc( psTreeNode->panShapeIds,
+ sizeof(int) * psTreeNode->nShapeCount );
+ psTreeNode->panShapeIds[psTreeNode->nShapeCount-1] = psObject->nShapeId;
+
+ if( psTreeNode->papsShapeObj != NULL )
+ {
+ psTreeNode->papsShapeObj = (SHPObject **)
+ SfRealloc( psTreeNode->papsShapeObj,
+ sizeof(void *) * psTreeNode->nShapeCount );
+ psTreeNode->papsShapeObj[psTreeNode->nShapeCount-1] = NULL;
+ }
+
+ return TRUE;
+}
+
+/************************************************************************/
+/* SHPTreeAddShapeId() */
+/* */
+/* Add a shape to the tree, but don't keep a pointer to the */
+/* object data, just keep the shapeid. */
+/************************************************************************/
+
+int SHPAPI_CALL
+SHPTreeAddShapeId( SHPTree * psTree, SHPObject * psObject )
+
+{
+ psTree->nTotalCount++;
+
+ return( SHPTreeNodeAddShapeId( psTree->psRoot, psObject,
+ psTree->nMaxDepth, psTree->nDimension ) );
+}
+
+/************************************************************************/
+/* SHPTreeCollectShapesIds() */
+/* */
+/* Work function implementing SHPTreeFindLikelyShapes() on a */
+/* tree node by tree node basis. */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPTreeCollectShapeIds( SHPTree *hTree, SHPTreeNode * psTreeNode,
+ double * padfBoundsMin, double * padfBoundsMax,
+ int * pnShapeCount, int * pnMaxShapes,
+ int ** ppanShapeList )
+
+{
+ int i;
+
+/* -------------------------------------------------------------------- */
+/* Does this node overlap the area of interest at all? If not, */
+/* return without adding to the list at all. */
+/* -------------------------------------------------------------------- */
+ if( !SHPCheckBoundsOverlap( psTreeNode->adfBoundsMin,
+ psTreeNode->adfBoundsMax,
+ padfBoundsMin,
+ padfBoundsMax,
+ hTree->nDimension ) )
+ return;
+
+/* -------------------------------------------------------------------- */
+/* Grow the list to hold the shapes on this node. */
+/* -------------------------------------------------------------------- */
+ if( *pnShapeCount + psTreeNode->nShapeCount > *pnMaxShapes )
+ {
+ *pnMaxShapes = (*pnShapeCount + psTreeNode->nShapeCount) * 2 + 20;
+ *ppanShapeList = (int *)
+ SfRealloc(*ppanShapeList,sizeof(int) * *pnMaxShapes);
+ }
+
+/* -------------------------------------------------------------------- */
+/* Add the local nodes shapeids to the list. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < psTreeNode->nShapeCount; i++ )
+ {
+ (*ppanShapeList)[(*pnShapeCount)++] = psTreeNode->panShapeIds[i];
+ }
+
+/* -------------------------------------------------------------------- */
+/* Recurse to subnodes if they exist. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < psTreeNode->nSubNodes; i++ )
+ {
+ if( psTreeNode->apsSubNode[i] != NULL )
+ SHPTreeCollectShapeIds( hTree, psTreeNode->apsSubNode[i],
+ padfBoundsMin, padfBoundsMax,
+ pnShapeCount, pnMaxShapes,
+ ppanShapeList );
+ }
+}
+
+/************************************************************************/
+/* SHPTreeFindLikelyShapes() */
+/* */
+/* Find all shapes within tree nodes for which the tree node */
+/* bounding box overlaps the search box. The return value is */
+/* an array of shapeids terminated by a -1. The shapeids will */
+/* be in order, as hopefully this will result in faster (more */
+/* sequential) reading from the file. */
+/************************************************************************/
+
+/* helper for qsort */
+static int
+compare_ints( const void * a, const void * b)
+{
+ return (*(int*)a) - (*(int*)b);
+}
+
+int SHPAPI_CALL1(*)
+SHPTreeFindLikelyShapes( SHPTree * hTree,
+ double * padfBoundsMin, double * padfBoundsMax,
+ int * pnShapeCount )
+
+{
+ int *panShapeList=NULL, nMaxShapes = 0;
+
+/* -------------------------------------------------------------------- */
+/* Perform the search by recursive descent. */
+/* -------------------------------------------------------------------- */
+ *pnShapeCount = 0;
+
+ SHPTreeCollectShapeIds( hTree, hTree->psRoot,
+ padfBoundsMin, padfBoundsMax,
+ pnShapeCount, &nMaxShapes,
+ &panShapeList );
+
+/* -------------------------------------------------------------------- */
+/* Sort the id array */
+/* -------------------------------------------------------------------- */
+
+ qsort(panShapeList, *pnShapeCount, sizeof(int), compare_ints);
+
+ return panShapeList;
+}
+
+/************************************************************************/
+/* SHPTreeNodeTrim() */
+/* */
+/* This is the recurve version of SHPTreeTrimExtraNodes() that */
+/* walks the tree cleaning it up. */
+/************************************************************************/
+
+static int SHPTreeNodeTrim( SHPTreeNode * psTreeNode )
+
+{
+ int i;
+
+/* -------------------------------------------------------------------- */
+/* Trim subtrees, and free subnodes that come back empty. */
+/* -------------------------------------------------------------------- */
+ for( i = 0; i < psTreeNode->nSubNodes; i++ )
+ {
+ if( SHPTreeNodeTrim( psTreeNode->apsSubNode[i] ) )
+ {
+ SHPDestroyTreeNode( psTreeNode->apsSubNode[i] );
+
+ psTreeNode->apsSubNode[i] =
+ psTreeNode->apsSubNode[psTreeNode->nSubNodes-1];
+
+ psTreeNode->nSubNodes--;
+
+ i--; /* process the new occupant of this subnode entry */
+ }
+ }
+
+/* -------------------------------------------------------------------- */
+/* We should be trimmed if we have no subnodes, and no shapes. */
+/* -------------------------------------------------------------------- */
+ return( psTreeNode->nSubNodes == 0 && psTreeNode->nShapeCount == 0 );
+}
+
+/************************************************************************/
+/* SHPTreeTrimExtraNodes() */
+/* */
+/* Trim empty nodes from the tree. Note that we never trim an */
+/* empty root node. */
+/************************************************************************/
+
+void SHPAPI_CALL
+SHPTreeTrimExtraNodes( SHPTree * hTree )
+
+{
+ SHPTreeNodeTrim( hTree->psRoot );
+}
+
+/************************************************************************/
+/* SwapWord() */
+/* */
+/* Swap a 2, 4 or 8 byte word. */
+/************************************************************************/
+
+static void SwapWord( int length, void * wordP )
+
+{
+ int i;
+ unsigned char temp;
+
+ for( i=0; i < length/2; i++ )
+ {
+ temp = ((unsigned char *) wordP)[i];
+ ((unsigned char *)wordP)[i] = ((unsigned char *) wordP)[length-i-1];
+ ((unsigned char *) wordP)[length-i-1] = temp;
+ }
+}
+
+/************************************************************************/
+/* SHPSearchDiskTreeNode() */
+/************************************************************************/
+
+static int
+SHPSearchDiskTreeNode( FILE *fp, double *padfBoundsMin, double *padfBoundsMax,
+ int **ppanResultBuffer, int *pnBufferMax,
+ int *pnResultCount, int bNeedSwap )
+
+{
+ int i;
+ int offset;
+ int numshapes, numsubnodes;
+ double adfNodeBoundsMin[2], adfNodeBoundsMax[2];
+
+/* -------------------------------------------------------------------- */
+/* Read and unswap first part of node info. */
+/* -------------------------------------------------------------------- */
+ fread( &offset, 4, 1, fp );
+ if ( bNeedSwap ) SwapWord ( 4, &offset );
+
+ fread( adfNodeBoundsMin, sizeof(double), 2, fp );
+ fread( adfNodeBoundsMax, sizeof(double), 2, fp );
+ if ( bNeedSwap )
+ {
+ SwapWord( 8, adfNodeBoundsMin + 0 );
+ SwapWord( 8, adfNodeBoundsMin + 1 );
+ SwapWord( 8, adfNodeBoundsMax + 0 );
+ SwapWord( 8, adfNodeBoundsMax + 1 );
+ }
+
+ fread( &numshapes, 4, 1, fp );
+ if ( bNeedSwap ) SwapWord ( 4, &numshapes );
+
+/* -------------------------------------------------------------------- */
+/* If we don't overlap this node at all, we can just fseek() */
+/* pass this node info and all subnodes. */
+/* -------------------------------------------------------------------- */
+ if( !SHPCheckBoundsOverlap( adfNodeBoundsMin, adfNodeBoundsMax,
+ padfBoundsMin, padfBoundsMax, 2 ) )
+ {
+ offset += numshapes*sizeof(int) + sizeof(int);
+ fseek(fp, offset, SEEK_CUR);
+ return TRUE;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Add all the shapeids at this node to our list. */
+/* -------------------------------------------------------------------- */
+ if(numshapes > 0)
+ {
+ if( *pnResultCount + numshapes > *pnBufferMax )
+ {
+ *pnBufferMax = (int) ((*pnResultCount + numshapes + 100) * 1.25);
+ *ppanResultBuffer = (int *)
+ SfRealloc( *ppanResultBuffer, *pnBufferMax * sizeof(int) );
+ }
+
+ fread( *ppanResultBuffer + *pnResultCount,
+ sizeof(int), numshapes, fp );
+
+ if (bNeedSwap )
+ {
+ for( i=0; i<numshapes; i++ )
+ SwapWord( 4, *ppanResultBuffer + *pnResultCount + i );
+ }
+
+ *pnResultCount += numshapes;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Process the subnodes. */
+/* -------------------------------------------------------------------- */
+ fread( &numsubnodes, 4, 1, fp );
+ if ( bNeedSwap ) SwapWord ( 4, &numsubnodes );
+
+ for(i=0; i<numsubnodes; i++)
+ {
+ if( !SHPSearchDiskTreeNode( fp, padfBoundsMin, padfBoundsMax,
+ ppanResultBuffer, pnBufferMax,
+ pnResultCount, bNeedSwap ) )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/************************************************************************/
+/* SHPSearchDiskTree() */
+/************************************************************************/
+
+int SHPAPI_CALL1(*)
+SHPSearchDiskTree( FILE *fp,
+ double *padfBoundsMin, double *padfBoundsMax,
+ int *pnShapeCount )
+
+{
+ int i, bNeedSwap, nBufferMax = 0;
+ unsigned char abyBuf[16];
+ int *panResultBuffer = NULL;
+
+ *pnShapeCount = 0;
+
+/* -------------------------------------------------------------------- */
+/* Establish the byte order on this machine. */
+/* -------------------------------------------------------------------- */
+ i = 1;
+ if( *((unsigned char *) &i) == 1 )
+ bBigEndian = FALSE;
+ else
+ bBigEndian = TRUE;
+
+/* -------------------------------------------------------------------- */
+/* Read the header. */
+/* -------------------------------------------------------------------- */
+ fseek( fp, 0, SEEK_SET );
+ fread( abyBuf, 16, 1, fp );
+
+ if( memcmp( abyBuf, "SQT", 3 ) != 0 )
+ return NULL;
+
+ if( (abyBuf[3] == 2 && bBigEndian)
+ || (abyBuf[3] == 1 && !bBigEndian) )
+ bNeedSwap = FALSE;
+ else
+ bNeedSwap = TRUE;
+
+/* -------------------------------------------------------------------- */
+/* Search through root node and it's decendents. */
+/* -------------------------------------------------------------------- */
+ if( !SHPSearchDiskTreeNode( fp, padfBoundsMin, padfBoundsMax,
+ &panResultBuffer, &nBufferMax,
+ pnShapeCount, bNeedSwap ) )
+ {
+ if( panResultBuffer != NULL )
+ free( panResultBuffer );
+ *pnShapeCount = 0;
+ return NULL;
+ }
+/* -------------------------------------------------------------------- */
+/* Sort the id array */
+/* -------------------------------------------------------------------- */
+ qsort(panResultBuffer, *pnShapeCount, sizeof(int), compare_ints);
+
+ return panResultBuffer;
+}
+
+/************************************************************************/
+/* SHPGetSubNodeOffset() */
+/* */
+/* Determine how big all the subnodes of this node (and their */
+/* children) will be. This will allow disk based searchers to */
+/* seek past them all efficiently. */
+/************************************************************************/
+
+static int SHPGetSubNodeOffset( SHPTreeNode *node)
+{
+ int i;
+ long offset=0;
+
+ for(i=0; i<node->nSubNodes; i++ )
+ {
+ if(node->apsSubNode[i])
+ {
+ offset += 4*sizeof(double)
+ + (node->apsSubNode[i]->nShapeCount+3)*sizeof(int);
+ offset += SHPGetSubNodeOffset(node->apsSubNode[i]);
+ }
+ }
+
+ return(offset);
+}
+
+/************************************************************************/
+/* SHPWriteTreeNode() */
+/************************************************************************/
+
+static void SHPWriteTreeNode( FILE *fp, SHPTreeNode *node)
+{
+ int i,j;
+ int offset;
+ unsigned char *pabyRec = NULL;
+
+ offset = SHPGetSubNodeOffset(node);
+
+ pabyRec = (unsigned char *)
+ malloc(sizeof(double) * 4
+ + (3 * sizeof(int)) + (node->nShapeCount * sizeof(int)) );
+
+ memcpy( pabyRec, &offset, 4);
+
+ /* minx, miny, maxx, maxy */
+ memcpy( pabyRec+ 4, node->adfBoundsMin+0, sizeof(double) );
+ memcpy( pabyRec+12, node->adfBoundsMin+1, sizeof(double) );
+ memcpy( pabyRec+20, node->adfBoundsMax+0, sizeof(double) );
+ memcpy( pabyRec+28, node->adfBoundsMax+1, sizeof(double) );
+
+ memcpy( pabyRec+36, &node->nShapeCount, 4);
+ j = node->nShapeCount * sizeof(int);
+ memcpy( pabyRec+40, node->panShapeIds, j);
+ memcpy( pabyRec+j+40, &node->nSubNodes, 4);
+
+ fwrite( pabyRec, 44+j, 1, fp );
+ free (pabyRec);
+
+ for(i=0; i<node->nSubNodes; i++ )
+ {
+ if(node->apsSubNode[i])
+ SHPWriteTreeNode( fp, node->apsSubNode[i]);
+ }
+}
+
+/************************************************************************/
+/* SHPWriteTree() */
+/************************************************************************/
+
+int SHPWriteTree(SHPTree *tree, const char *filename )
+{
+ char signature[4] = "SQT";
+ int i;
+ char abyBuf[32];
+ FILE *fp;
+
+/* -------------------------------------------------------------------- */
+/* Open the output file. */
+/* -------------------------------------------------------------------- */
+ fp = fopen(filename, "wb");
+ if( fp == NULL )
+ {
+ return FALSE;
+ }
+
+/* -------------------------------------------------------------------- */
+/* Establish the byte order on this machine. */
+/* -------------------------------------------------------------------- */
+ i = 1;
+ if( *((unsigned char *) &i) == 1 )
+ bBigEndian = FALSE;
+ else
+ bBigEndian = TRUE;
+
+/* -------------------------------------------------------------------- */
+/* Write the header. */
+/* -------------------------------------------------------------------- */
+ memcpy( abyBuf+0, signature, 3 );
+
+ if( bBigEndian )
+ abyBuf[3] = 2; /* New MSB */
+ else
+ abyBuf[3] = 1; /* New LSB */
+
+ abyBuf[4] = 1; /* version */
+ abyBuf[5] = 0; /* next 3 reserved */
+ abyBuf[6] = 0;
+ abyBuf[7] = 0;
+
+ fwrite( abyBuf, 8, 1, fp );
+
+ fwrite( &(tree->nTotalCount), 4, 1, fp );
+
+ /* write maxdepth */
+
+ fwrite( &(tree->nMaxDepth), 4, 1, fp );
+
+/* -------------------------------------------------------------------- */
+/* Write all the nodes "in order". */
+/* -------------------------------------------------------------------- */
+
+ SHPWriteTreeNode( fp, tree->psRoot );
+
+ fclose( fp );
+
+ return TRUE;
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-maptools.git
More information about the debian-science-commits
mailing list