Re: [Geotools-gt2-users] Close MapContext without closing tool!

2010-05-26 Thread Michael Bedward
Hi Linda, >> hey guys >> is it possible to close a MapContext without closing my program/tool? How? I >> have a create MapContext button with a layer. After watching it, I want to >> close this window. But my tool is closed than too. Do you mean JMapFrame ? The default for that is to exit when th

Re: [Geotools-gt2-users] Get selected layer in GeoTools.

2010-05-26 Thread Michael Bedward
Hi Amador, > If somebody want to use this code or have a suggest, feel free to email me. Great to hear you got it working. You can just use the MapContext instead of creating a separate list of FeatureSources if you want... //Select the shapefile to work... FeatureSource f = mMapContext

Re: [Geotools-gt2-users] ColorMap on polygons

2010-05-26 Thread Enamul Haque
I'm just calling polygonSymbolizer.setFill(styleBuilder.createFill(new ColorRampFunction(colorList))). I have one featuretypestyle with one rule. On 2010-05-27, at 12:18 AM, Michael Bedward wrote: > Hello Enamul, > >> I tried this really simple example to color the map based on the >> hashcode

Re: [Geotools-gt2-users] Help please!

2010-05-26 Thread Michael Bedward
On 27 May 2010 11:51, Ben Caradoc-Davies wrote: > > Maven is terrible, but the only thing worse than using maven is not > using maven. Resistance is futile. You will be assimilated. > I want that on a t-shirt :-) Michael ---

Re: [Geotools-gt2-users] ColorMap on polygons

2010-05-26 Thread Michael Bedward
Hello Enamul, > I tried this really simple example to color the map based on the > hashcode of the geometry. But it seems to be drawing all the shapes > with a single color on every refresh. What am I doing wrong here ? It sounds like your function is only being called once to set the fill for al

Re: [Geotools-gt2-users] Help please!

2010-05-26 Thread Ben Caradoc-Davies
On 26/05/10 18:41, Juan Ramirez wrote: > I just want the necessary jars (the Maven installation is a headache) Maven is terrible, but the only thing worse than using maven is not using maven. Resistance is futile. You will be assimilated. Follow the quickstart link posted by Jan. You only have t

Re: [Geotools-gt2-users] geotools+linesegment

2010-05-26 Thread Michael Bedward
Hello, > Now, i want to draw in red color one road not all the roads. i have readed > the Linestring > or LineSegment  class, but i don't know how to add this class in the > MapContext. You don't need to worry about adding a LineString etc. Instead you define a Style that will control the colou

Re: [Geotools-gt2-users] ColorMap on polygons

2010-05-26 Thread Enamul Haque
I tried this really simple example to color the map based on the hashcode of the geometry. But it seems to be drawing all the shapes with a single color on every refresh. What am I doing wrong here ? public ColorRampFunction(List fillColors) { super("colorramp"); fillColors_.ad

Re: [Geotools-gt2-users] reading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Simone Giannecchini
So, you are telling me that you get that error right away during a simple read on the reader without params? This is rather strange, we might probably want to chat a bit on IRC tomorrow to spot the cause. K? Simone. --- Ing. Simone Giannecchini

Re: [Geotools-gt2-users] reading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Jan Torben Heuer
Simone Giannecchini wrote: I simplified the code a bit but the exception remains: import java.io.IOException; import java.io.InputStream; import org.geotools.coverage.grid.GridCoverage2D; import org.geotools.data.DataSourceException; import org.geotools.gce.geotiff.GeoTiffFormat; import org.geoto

Re: [Geotools-gt2-users] reading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Simone Giannecchini
I would like to see the code that you using to read the data. Simone, --- Ing. Simone Giannecchini GeoSolutions S.A.S. Founder - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob:

Re: [Geotools-gt2-users] reading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Jan Torben Heuer
Simone Giannecchini wrote: Hi Simone, > I would try with something as simple as gdal_translate in.tif out.tiff > to see if it s fixes the problem. Id did it. This - at least - changes the error message: Source or destination region is empty. Error: One factory fails for the operation "ImageRea

Re: [Geotools-gt2-users] Reprojection?!

2010-05-26 Thread Simone Giannecchini
do you have a prj for this data that contains the definition of the coordinate reference system? Looking at the coordinates in the header of the file I can tell this data is ina projected crs but if you don't have the prj the code will assume wgs84 and proceed. From that point and on, you cannot re

Re: [Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Simone Giannecchini
Ciao jan, i have tested the file you sent me with geotools 2.6.x and it worked fine. Can you give some details about the system you are playing with? Java versions, sisop, etc..? Also it might be worth to try 2.6.4, which has just been release. Simone.

Re: [Geotools-gt2-users] reading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Simone Giannecchini
On Wed, May 26, 2010 at 5:12 PM, Jan Torben Heuer wrote: > Daniele Romagnoli wrote: > > Hi Daniele, Simone, > >> the TIFF 6.0 specification states that "*The entries in an IFD must be >> sorted in ascending order by Tag*": (See Section 2, page 15 at [1]) >> As suggested by Simone, I think that the

Re: [Geotools-gt2-users] longitude and latitude invertion using WKT

2010-05-26 Thread Jean Marie
that is the point ! I only wanted to work with WKT string I thought I had a chance with something like that : crsDest=ReferencingFactoryFinder.getCRSFactory(new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE)).createFromWKT(); but it doesn't work either well the reason why I

Re: [Geotools-gt2-users] Get selected layer in GeoTools.

2010-05-26 Thread Amador Antonio Cuenca
Thanks a lot. I try one different way, but It works... //I use *miLista* to track the source of each shapefile private List> miLista = new ArrayList(); private void mostrarShapeFile(File mFile) throws Exception { FileDataStore mDataStore = FileDataStoreFinder.getDataStore(mFile); F

Re: [Geotools-gt2-users] reading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Jan Torben Heuer
Daniele Romagnoli wrote: Hi Daniele, Simone, > the TIFF 6.0 specification states that "*The entries in an IFD must be > sorted in ascending order by Tag*": (See Section 2, page 15 at [1]) > As suggested by Simone, I think that the ImageI/O is not happy to handle > files which don't respect this c

Re: [Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Daniele Romagnoli
Hi Jan, the TIFF 6.0 specification states that "*The entries in an IFD must be sorted in ascending order by Tag*": (See Section 2, page 15 at [1]) As suggested by Simone, I think that the ImageI/O is not happy to handle files which don't respect this constraint. Regards, Daniele [1]: http://partn

[Geotools-gt2-users] longitude and latitude invertion

2010-05-26 Thread Martin Tomko
Jean Marie, if you don't have to parse the wkt for some internal reasons, you can use the EPSG db provided by GT. You can then do: boolean forceLonFirst = true; crsDest = CRS.decode("EPSG:4326", forceLonFirst); When you parse a wkt, I think it takes what you exactly specify. You could probably t

Re: [Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Juan Ramirez
Hi Jan, Thanks again. I´m trying to examine a Landsat7 multispectral image, with 7 bands in a single TIF file, and some metadata in it´s header. I just want to access to pixels of each band and manipulate them to make some corrections, and leave the TIF with the same metadata. Geotools seems

Re: [Geotools-gt2-users] longitude and latitude invertion

2010-05-26 Thread Jan Torben Heuer
Jean Marie wrote: > can I get the longitude first in any case ? I think this is a FAQ I also run into as newbe ;-) new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE) set the hints whenever you can... Cheers Jan -- >From address is valid until 01.06.2010 ---

Re: [Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Simone Giannecchini
On Wed, May 26, 2010 at 4:32 PM, Jan Torben Heuer wrote: > On Wednesday 26 May 2010 16:09:14 Simone Giannecchini wrote: > Hi, > >> Ciao Jan, >> this does not look like a problem related to having or not some >> dependencies in your path. >> It looks like imageio is not able to correctly read this

[Geotools-gt2-users] longitude and latitude invertion

2010-05-26 Thread Jean Marie
Hello surely an easy problem but I don't find the way to solve it ; i do some tranformation from one coordinate sytem to another through the folllowing code : crsSrc = CRS.parseWKT("wkt string from epsg "); crsDest = CRS.parseWKT("wkt string from epsg 4326");

Re: [Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Jan Torben Heuer
On Wednesday 26 May 2010 16:09:14 Simone Giannecchini wrote: Hi, > Ciao Jan, > this does not look like a problem related to having or not some > dependencies in your path. > It looks like imageio is not able to correctly read this tiff. Hi Simone, I just tried udig and it works (so it should work

Re: [Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Simone Giannecchini
Ciao Jan, this does not look like a problem related to having or not some dependencies in your path. It looks like imageio is not able to correctly read this tiff. -1- Can you try a gdalinfo on it and paste the result? -2- Can you send over some sample data? Simone. --

Re: [Geotools-gt2-users] Geotools & GeoTiff & java

2010-05-26 Thread Andrea Aime
Jan Torben Heuer ha scritto: > On Wednesday 26 May 2010 15:17:21 you wrote: > Hi, > >> Hi Jan, thanks for responsing. >> I have installed Maven and now I understand how to get packages :) >> >> But still I don´t know what packages/dependencies/repositories do I need > in >> order to compile Geot

Re: [Geotools-gt2-users] Geotools & GeoTiff & java

2010-05-26 Thread Jan Torben Heuer
On Wednesday 26 May 2010 15:17:21 you wrote: Hi, > Hi Jan, thanks for responsing. > I have installed Maven and now I understand how to get packages :) > > But still I don´t know what packages/dependencies/repositories do I need in > order to compile Geotiff examples. (GeotiffReader, GeoTiffForm

[Geotools-gt2-users] geotools+linesegment

2010-05-26 Thread arnauld ndefo
Hello everybody,i have stored the information about my map in the database postgis. I have used geotool to draw my map from the information which are in the database.This was a succed.Now, i want to draw in red color one road not all the roads. i have readed the Linestring or LineSegment  class,

Re: [Geotools-gt2-users] geotools+tiles

2010-05-26 Thread christian . mueller
Perhaps this helps http://docs.geoserver.org/stable/en/user/tutorials/imagepyramid/imagepyramid.html Do you have pyramids already. ? If not you have to start with gdal_retile.py Quoting arnauld ndefo : > Hello everybody,i have on my disk many folders and in these folders > we have a lot of

[Geotools-gt2-users] geotools+tiles

2010-05-26 Thread arnauld ndefo
Hello everybody,i have on my disk many folders and in these folders we have a lot of image .png which represent the tiles of my map. I want to put together all these tiles with geotools to form my map?? Another thing please, i search how i can draw a LineSegment on a map with geo

Re: [Geotools-gt2-users] Help please!

2010-05-26 Thread Jan Torben Heuer
Juan Ramirez wrote: Sorry but I can just give you the hint to try maven. Its worth the time (and searching jar files by hand isn't really fun) http://www.geotools.org/quickstart.html helped me to set up my project. Cheers, Jan P.S. a more specific subject may give you more answers. -- >From a

[Geotools-gt2-users] Geotools & GeoTiff & java

2010-05-26 Thread juansperate
Hi, I have some multi-band GeoTiffs, and I want to make a pixel level processing in java. I´m quite desperate because I don´t understand Geotools. I just want the necessary jars (the Maven installation is a headache), so I´ve downloaded the geotools-2.6.4 jar package (and included them... and JA

[Geotools-gt2-users] Help please!

2010-05-26 Thread Juan Ramirez
Hi, I have some multi-band GeoTiffs, and I want to make a pixel level processing in java. I´m quite desperate because I don´t understand Geotools. I just want the necessary jars (the Maven installation is a headache), so I´ve downloaded the geotools-2.6.4 jar package (and included them... and

[Geotools-gt2-users] rading geotiff: One factory fails for the operation "ImageRead"

2010-05-26 Thread Jan Torben Heuer
Hi, I'm reading a geotiff (ASTER GDEM) but it fails with the error message "One factory fails for the operation "ImageRead"" and "Caused by: javax.imageio.IIOException: I/O error reading header!" I'm not sure if JAI isn't properly set up (but scaling PNGs work for example) or the GeoTiff is bro

Re: [Geotools-gt2-users] Reprojection?!

2010-05-26 Thread Adnila
of course I can. here you are! this is my code for the resampling method: gc2D is input coverage, gridcellwidth is the needed cell width and gridcellwidthold is the old one, which should be changed. public GridCoverage2D gridResample(GridCoverage2D gc2D, double gridCellWidth, double gridCellWidt