3 Jan 17:13 2008

### Street Selection Project

```As promised, here is a link to my project that used self-organizing maps
for street selection.  Feel free to use some code as examples.
http://www.scs.carleton.ca/~gbanaszk/school/courses/StreetSelectionProject.zip

Gail

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
```
3 Jan 21:09 2008

### Re: Graphs, Nodes and Points. Argentinian Coordinates

```
Justin: Thank you very much for your support. It was very helpful.
Here I put the answer you gave me and my code so other users may understand
the solution.
The summary of the things I had to do to achieve getting the distance in
meters from one point to another of the city of Cordoba, Argentina:
1. Use the epsg-hsql plugin by modifying the POM.xml file that maven uses
adding the following in the dependencies section:
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt2-epsg-hsql</artifactId>
<version>2.4-SNAPSHOT</version>
</dependency>
2. Transform the projected coordinates that were in my graph of the city by
searching a correct EPSG code for my data. I found the corresponding epsg
Justin gave me the right hint on how to transform the coordinates:
/-------------------------------------------- written by Justin
--------------------------------------------------------
Point p = ...;

//create the transformation
CoordinateReferenceSystem crs1 = CRS.decode( "EPSG:4694" );
CoordinateReferenceSystem crs2 = CRS.decode( "EPSG:4326" );

MathTransform tx = CRS.findMathTransform( crs1, crs2, true );

//transform the point
double[] projected = new double[]{ p.getX(), p.getY() };
double[] longlat = new double[2];
```

4 Jan 00:16 2008

### Re: Graphs, Nodes and Points. Argentinian Coordinates

```Great Fran.. Glad it worked out for you. Thanks for documenting your
findings for the use of other users. I will be sure to throw them into
the user guide.

-Justin

FranGM wrote:
> Justin: Thank you very much for your support. It was very helpful.
> Here I put the answer you gave me and my code so other users may understand
> the solution.
> The summary of the things I had to do to achieve getting the distance in
> meters from one point to another of the city of Cordoba, Argentina:
> 1. Use the epsg-hsql plugin by modifying the POM.xml file that maven uses
> adding the following in the dependencies section:
>         <dependency>
> 	    <groupId>org.geotools</groupId>
> 	    <artifactId>gt2-epsg-hsql</artifactId>
> 	    <version>2.4-SNAPSHOT</version>
> 	</dependency>
> 2. Transform the projected coordinates that were in my graph of the city by
> searching a correct EPSG code for my data. I found the corresponding epsg
> Justin gave me the right hint on how to transform the coordinates:
> /-------------------------------------------- written by Justin
> --------------------------------------------------------
> Point p = ...;
>
> //create the transformation
> CoordinateReferenceSystem crs1 = CRS.decode( "EPSG:4694" );
> CoordinateReferenceSystem crs2 = CRS.decode( "EPSG:4326" );
```

7 Jan 21:07 2008

### Geotools, JTS and the North Pole

```
Since Geotools relies so heavily on JTS, is there any way to make it
accurately calculate the correct maximum Y value for a Geomety that
encompasses but does not contain the north pole? If not, how can I override
the envelope calculations?

For example, if I create a Polygon that contains the North Pole, my maximum
Latitude is 90. Below is a code snippet, that does just that. The max and
min values are both 85.

It seems that no matter what SRS I use, I will always run into this problem.
My largest (northernmost) point is not contained in any of the coordinates
that make up the polygon. Is there anyway around this limitation?

GeometryFactory gf = new GeometryFactory(new
PrecisionModel(PrecisionModel.FLOATING), 4326);
Coordinate[] containsNP = new Coordinate[5];
containsNP[0] = new Coordinate(-60, 85);
containsNP[1] = new Coordinate(160, 85);
containsNP[2] = new Coordinate(120, 85);
containsNP[3] = new Coordinate(-20, 85);
containsNP[4] = new Coordinate(-60, 85);
LinearRing exteriorNP = gf.createLinearRing(containsNP);
Polygon NPPolygon = gf.createPolygon(exteriorNP, holes);
Envelope env = NPPolygon.getEnvelopeInternal();
System.out.println("Here is the envelope of the polygon that crosses
180");
System.out.println("Min Y: " + env.getMinY());
System.out.println("Max Y: " + env.getMaxY());
--

--
```

9 Jan 20:57 2008

### FIDs and file name changes

```I am using GT 2.4 to do some geo-spatial processing, the end result of
which I end up with some FIDS like file.1, file.2 and so on with some
values to go with them.  These go into an H2 DB for later use.

I also have a GT 2.0 (I know I shouldn't, but I just love the styled map
pane) app that then uses those FIDs to do some coloration of some maps.
In the process of writing the app it had the initial layer (file) copied
twice and renamed to file_first and file_second. This seems to break the
FID filters because now the FIDS look something like file_first.1,
file_first.2, etc.

Is there anyway I can get the FID filter to just look at the numbers and
ignore the rest of the FID?

Aaron Parks

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
```
10 Jan 00:09 2008

### Re: FIDs and file name changes

```There is good alternative to StyledMapPane now on geotools trunk  I
am afraid the FIDs more represent a selection on a single service (in
this case a file) rather than something abstract. If you had an ID
attribute in your file you could use that for a stable filter regardless
of data source.

Thanks for the interesting question,
Jody
> I am using GT 2.4 to do some geo-spatial processing, the end result of
> which I end up with some FIDS like file.1, file.2 and so on with some
> values to go with them.  These go into an H2 DB for later use.
>
> I also have a GT 2.0 (I know I shouldn't, but I just love the styled map
> pane) app that then uses those FIDs to do some coloration of some maps.
> In the process of writing the app it had the initial layer (file) copied
> twice and renamed to file_first and file_second. This seems to break the
> FID filters because now the FIDS look something like file_first.1,
> file_first.2, etc.
>
> Is there anyway I can get the FID filter to just look at the numbers and
> ignore the rest of the FID?
>
> Aaron Parks
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
```

10 Jan 01:58 2008

### Re: FIDs and file name changes

```That's actually what I had been doing previously by creating an
attribute Expression off a field in the DBF and using a bunch of
filter.or(exp) to point at the attribute.  However I thought it might
make more sense to use the FIDs since they are unique and it de-clutters
the DBF a bit.

One last question: In the case of a shape file "service" is the FID
always the form "fileNameNoExt.ID"?

Aaron Parks

-----Original Message-----
From: Jody Garnett [mailto:jgarnett@...]
Sent: Wednesday, January 09, 2008 6:10 PM
To: Parks, Aaron B.
Cc: geotools-gt2-users@...
Subject: Re: [Geotools-gt2-users] FIDs and file name changes

There is good alternative to StyledMapPane now on geotools trunk  I
am afraid the FIDs more represent a selection on a single service (in
this case a file) rather than something abstract. If you had an ID
attribute in your file you could use that for a stable filter regardless

of data source.

Thanks for the interesting question,
Jody
> I am using GT 2.4 to do some geo-spatial processing, the end result of
> which I end up with some FIDS like file.1, file.2 and so on with some
> values to go with them.  These go into an H2 DB for later use.
```

10 Jan 08:50 2008

### Re: FIDs and file name changes

```Parks, Aaron B. ha scritto:
> That's actually what I had been doing previously by creating an
> attribute Expression off a field in the DBF and using a bunch of
> filter.or(exp) to point at the attribute.  However I thought it might
> make more sense to use the FIDs since they are unique and it de-clutters
> the DBF a bit.
>
> One last question: In the case of a shape file "service" is the FID
> always the form "fileNameNoExt.ID"?

Yes, it's always like that. We have no way to tell that your old
file xxx became file yyy...
Cheers
Andrea

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
```
10 Jan 12:15 2008

### Error creating LineStyle

```Hi

I'm following the User Manual[1] to display a shapefile over a map. As
you can see I copy & paste the manual's example code but it doesn't work.
It fails with the following error:

--
PanelGeoMap.java:149: setWidth(org.geotools.filter.Expression) in
org.geotools.styling.Stroke cannot be applied to
(org.opengis.filter.expression.Literal)
symbolizer.getStroke().setWidth(filterFactory.literal(1));

PanelGeoMap.java:150: setColor(org.geotools.filter.Expression) in
org.geotools.styling.Stroke cannot be applied to
(org.opengis.filter.expression.Literal)

symbolizer.getStroke().setColor(filterFactory.literal(color));
2 errors
--

I've read the geotools and opengis javadocs[2] and I don't know how I can
fix the problem.

Any help will be appreciated. Thanks in advance.

[1] http://docs.codehaus.org/display/GEOTDOC/09+ShapeLab

--- CODE START
```

10 Jan 14:05 2008

### Re: FIDs and file name changes

```I was more concerned that I would hit some odd corner case that would
break the pattern and make the FID harder to track.  In my case I know
the file name (I just opened it after all) and the FID Number, so I can
build up the FIDs as I go along.

Aaron Parks

-----Original Message-----
From: Andrea Aime [mailto:aaime@...]
Sent: Thursday, January 10, 2008 2:51 AM
To: Parks, Aaron B.
Cc: Jody Garnett; geotools-gt2-users@...
Subject: Re: [Geotools-gt2-users] FIDs and file name changes

Parks, Aaron B. ha scritto:
> That's actually what I had been doing previously by creating an
> attribute Expression off a field in the DBF and using a bunch of
> filter.or(exp) to point at the attribute.  However I thought it might
> make more sense to use the FIDs since they are unique and it
de-clutters
> the DBF a bit.
>
> One last question: In the case of a shape file "service" is the FID
> always the form "fileNameNoExt.ID"?

Yes, it's always like that. We have no way to tell that your old
file xxx became file yyy...
Cheers
```