On Tue, Mar 23, 2010 at 3:02 PM, Adnila <[email protected]> wrote: > > hi at all. > I am trying to reproject a shape file into another transformation and write > it into a new file. > everything runs fine. but when I am trying to read in the new written shape > file, it gets this error. and I have no idea what to do. > > SCHWERWIEGEND: Points of LinearRing do not form a closed linestring > java.lang.IllegalArgumentException: Points of LinearRing do not form a > closed linestring > at > com.vividsolutions.jts.geom.LinearRing.validateConstruction(LinearRing.java:105) > at com.vividsolutions.jts.geom.LinearRing.<init>(LinearRing.java:100) > at > com.vividsolutions.jts.geom.GeometryFactory.createLinearRing(GeometryFactory.java:339) > at > com.vividsolutions.jts.geom.GeometryFactory.createLinearRing(GeometryFactory.java:329) > at > org.geotools.filter.BBoxExpressionImpl.setBounds(BBoxExpressionImpl.java:91) > at > org.geotools.filter.BBoxExpressionImpl.<init>(BBoxExpressionImpl.java:66) > at > org.geotools.filter.FilterFactoryImpl.createBBoxExpression(FilterFactoryImpl.java:593) > at > org.geotools.filter.FilterFactoryImpl.bbox(FilterFactoryImpl.java:303) > at > org.geotools.filter.FilterFactoryImpl.bbox(FilterFactoryImpl.java:280) > at > org.geotools.filter.visitor.DuplicatingFilterVisitor.visit(DuplicatingFilterVisitor.java:214) > at org.geotools.renderer.lite.FastBBOX.accept(FastBBOX.java:113) > at > org.geotools.renderer.lite.StreamingRenderer.queryLayer(StreamingRenderer.java:978) > at > org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1774) > at > org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:699) > at > org.geotools.swing.RenderingExecutor$Task.call(RenderingExecutor.java:148) > at > org.geotools.swing.RenderingExecutor$Task.call(RenderingExecutor.java:104) > at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) > at java.util.concurrent.FutureTask.run(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown > Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > > whats the matter? the code snippet I am using, is from > http://svn.osgeo.org/geotools/trunk/demo/example/src/main/java/org/geotools/demo/CRSLab.java > > I have a second question, too. > I am trying the following: I want to receive a shape file from the user, put > it into another crs and then rasterize it by give the user the opportunity > to choose an attribute. the other attributes shall be put in kind of a > matrix like an appendix. and every cell needs a new and unique identifier. > is this possible? how can I do this. > Is there a possibility to set very special parameters for a grid coverage? I > want to set the resolution of one cell in meter or kilometer, the origin in > the lower left corner and grid orientation and stuff like that. Is this > possible?
GridCoverage are just wrappers around what Java and especially JAI can do (at least in terms of managing data). So what you are talking about is feasible but you need to code most part of that yourself. As an instance you might want to create a WritableRaster of specific (W,H) and with a specific number of bands ( I assume one is enough for your case), then you need to start looping onto it, getting the value from the shapefile and setting it on the raster. Once you have a Raster you can specify an affine transform to impose the resolution and offset ( I am guessing that this affine transform will be a simple scale and translate where the scale is the resolution you can compute using the envelope of the data and the raster dimensions, and where the translation maps the upper left corner (0,0) of the raster to the upper left corner of the model (ULC of the envelope, with an half pixel shift). I know this is not easy, but this should ring more than one bel to you aobut how to move forward. Simone. > > Sorry for the huge amount of questions. But I am so confused and I tried so > many thinks already. > Thanks for your help. I would really appreciate that. > > -- > View this message in context: > http://n2.nabble.com/GridCoverage-Error-Points-of-LinearRing-do-not-form-a-closed-linestring-raster-attribute-matrix-tp4783764p4783764.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
