Re: [Geotools-gt2-users] nonstandard polygon

2011-07-08 Thread Larry Reeder
You could try a multipolygon, with one of the subpolygons from -179.000 to -179.9, and the other from 179. to 179.000. That way you'd have one feature, with a geometry where 0,0 is outside of it. -Larry On Fri, Jul 8, 2011 at 9:20 AM, Oleksandr Huziy wrote: > Hello, > > I am a

Re: [Geotools-gt2-users] Precision and scale from a real field in a shape file

2011-05-29 Thread Larry Reeder
Since field length and degrees of precision are all stored in the DBF part of the shapefile, one approach is to use the low-level GeoTools classes DbaseFileReader, and DbaseFileWriter to parse and update the DBF file. Both of those classes make use of a utility class called DbaseFileHeader with me

Re: [Geotools-gt2-users] creation of standard shapes

2010-12-07 Thread Larry Reeder
Neil, The OpenGis Simple Features specification doesn't support some of the shapes used in the mobile domain like Circle, Ellipse, and ArcBand, and components built on top of that Simple Features spec like GeoTools, JTS, WKT, and PostGIS are also unlikely to support them as first-class shapes. Yo

Re: [Geotools-gt2-users] writing shapefiles to stream

2010-09-30 Thread Larry Reeder
Oleg, This is a fair amount of work, but you may be able to subclass a version of java.nio.channels.FileChannel to read/write only to memory, and then use the lower-level GeoTools ShapefileWriter and DbaseFileWriter classes to write to your memory-based FileChannel. This would get you an in-memor

Re: [Geotools-gt2-users] Maintaining line order when creating a shapefile

2010-09-20 Thread Larry Reeder
2:51 AM, GTn00b wrote: > > Thanks for your reply Larry. > > > Larry Reeder wrote: >> >> If you're using MemoryFeatureCollection, it's backed by a TreeMap >> which sorts by Feature Id. > > Using the CSV 2 SHP Lab as an example, on line 79 of >

Re: [Geotools-gt2-users] Maintaining line order when creating a shapefile

2010-09-16 Thread Larry Reeder
If you're using MemoryFeatureCollection, it's backed by a TreeMap which sorts by Feature Id.You could use LeanFeatureCollection as an alternative. I think it's slated for addition to GeoTools at some future date (not sure if it's in the 2.7-M releases), but if it's not availabe now you could

Re: [Geotools-gt2-users] MrSID Geo Points

2010-08-30 Thread Larry Reeder
Frank, I haven't worked with MrSIDIIOImageMetadata, but I have done the following for GeoTIFFs, which might work in your situation: 1. Get the upper left coordinate from the image metadata 2. Get the pixel width and height in map units. 3. Get the image width and height. 4. Assume pixel width and

Re: [Geotools-gt2-users] Is there a FeatureCollection that maintains the order of the added features?

2010-04-23 Thread Larry Reeder
> > The DefaultFeatureColleciton sorts the feature by feature id in order to > better match what a shapefile does for testing. > > Jody > > On 24/04/2010, at 12:33 AM, Larry Reeder wrote: > >> Hello all, >> >> I'm looking for a feature collection s

[Geotools-gt2-users] Is there a FeatureCollection that maintains the order of the added features?

2010-04-23 Thread Larry Reeder
Hello all, I'm looking for a feature collection similar to MemoryFeatureCollection, but which behaves like a List and maintains the order of features I put in it with add(). MemoryFeatureCollection is backed by a TreeMap and changes my insert ordering. Is there something like a ListFeatureCollecti

Re: [Geotools-gt2-users] Read data from .dbf file

2010-04-14 Thread Larry Reeder
I've had pretty good success with DbaseFileReader, but the javadoc is out of date. Here's an example that should work (warning, I haven't tried to compile this). The example assumes the first field has a character data type and the second has a numeric data type: FileInputStream fis = new FileIn

Re: [Geotools-gt2-users] Lookup or determine UTM Zone for lat/long pair

2009-12-08 Thread Larry Reeder
Oops, I think that should be ceiling( (180 + lng) / 6), where lngs west of Greenwich are < zero. -Larry On Tue, Dec 8, 2009 at 9:59 AM, Larry Reeder wrote: > (sorry about the dup Rob, I meant to send this to the list, not you directly) > > Hey Rob, > > I'm no

Re: [Geotools-gt2-users] Lookup or determine UTM Zone for lat/long pair

2009-12-08 Thread Larry Reeder
(sorry about the dup Rob, I meant to send this to the list, not you directly) Hey Rob, I'm not sure about a Geotools mechanism, but if you read up on UTM zones in Wikipedia, you'll see there is a straightforward mathematical test you can use to determine which UTM zone a lat-lng point falls in.

[Geotools-gt2-users] Setting number of decimals in DBF record when using ShapefileD

2009-12-03 Thread Larry Reeder
Hey all, Older versions of ShapefileDataStore (2.3 was the last one I checked) didn't support setting the number of decimals for numeric types in DBF records. See DbaseFileHeader.addColumn(...), which does allow setting a decimal count. Is this supported in the 2.6 version of ShapefileDataStore?

Re: [Geotools-gt2-users] Writing multiple polygons to 1 .shp and creating attributes in .dbf

2009-10-21 Thread Larry Reeder
Hey Elaine, The class ShapefileDataStore should do what you want: http://javadoc.geotools.fr/2.6/org/geotools/data/shapefile/ShapefileDataStore.html You may also want to check out the user guide for creating a datastore: http://docs.codehaus.org/display/GEOTDOC/04+How+to+Create+a+DataStore+or+D

Re: [Geotools-gt2-users] Generating a PRJ compatible with ArcMap

2009-02-20 Thread Larry Reeder
st approach to a fix. -Larry On Fri, Feb 6, 2009 at 9:40 AM, Martin Desruisseaux wrote: > Larry Reeder a écrit : >> >> However, there are some substantive differences in the prj file that's >> written out by ShapefileDataStore. ArcMap specifically seems to have &

[Geotools-gt2-users] Generating a PRJ compatible with ArcMap

2009-02-06 Thread Larry Reeder
Hello all, I'm reprojecting a shapefile using geotools, but ArcMap doesn't recognize the metadata in the PRJ. The incoming shapefile is in geographic coordinates, and the output projection is specified by an EPSG code. In this specific case, I'm using EPSG:32735 (UTM Zone 35S) I'm using CRS.de