## geotools-gt2-users

 [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: FranGM - 2007-12-27 20:15:20 ```Hi there. I've got a shapefile of my city which a turned into a graph. Now I wanted to use a DijkstraShortestPathFinder. To create a weighter I want to find out the length of each edge of the graph (the orthodromic distance between its nodes). Each Node has a "getObject" method from where you can get a Point with coordinates. What I would like to know is how are this coordinates (big doubles with around 7 non decimal ciphers) related to "real coordinates" (lat/long). Thing is, my data seems to be in ARGENTINA POSGAR94, zone 4, datum WGS84 (as I can read in the readme file). I found over the net that this corresponds to EPSG:4694, but it seems that the GeodeticCalculator class does not know about it. In other words, I think I'm getting troubled with something that is probably easy. May anyone lend me a hand in this subject? Thanks in advance Fran -- View this message in context: http://www.nabble.com/Graphs%2C-Nodes-and-Points.-Argentinian-Coordinates-tp14517968p14517968.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: Justin Deoliveira - 2007-12-28 18:44:51 ```Hi Fran, I am not exactly sure I understand the problem. Working with the graph in projected coordinates should work just fine, there should be no need to transform the coordinates to lat/long, unless you have that requirement. As for EPSG:4694, i notice that it is supported in recent version of geotools: GEOGCS["POSGAR 94", DATUM["Posiciones Geodesicas Argentinas 1994", SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], AUTHORITY["EPSG","6694"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4694"]] Which version are you using? -Justin FranGM wrote: > Hi there. > I've got a shapefile of my city which a turned into a graph. Now I wanted to > use a DijkstraShortestPathFinder. To create a weighter I want to find out > the length of each edge of the graph (the orthodromic distance between its > nodes). > Each Node has a "getObject" method from where you can get a Point with > coordinates. What I would like to know is how are this coordinates (big > doubles with around 7 non decimal ciphers) related to "real coordinates" > (lat/long). > Thing is, my data seems to be in ARGENTINA POSGAR94, zone 4, datum WGS84 (as > I can read in the readme file). I found over the net that this corresponds > to EPSG:4694, but it seems that the GeodeticCalculator class does not know > about it. > In other words, I think I'm getting troubled with something that is probably > easy. > May anyone lend me a hand in this subject? > > Thanks in advance > > Fran > -- Justin Deoliveira The Open Planning Project http://topp.openplans.org ```
 Re: [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: FranGM - 2007-12-28 19:28:23 ```Hi Justin. Thanks for your quick answer! I'm currently using geotools 2.4 and I don't want to switch to 2.5 yet given the fact that the project I'm on is to be used by the comunity of my city, so I would like to work with the more stable possible version. In this version, I tried to make a CRS.decode("EPSG:4694") but didn't success. What I am willing to do (the intentions at least) you can see it in this little piece of non-working code: (you can say it is pseudo code) public double distance(Node orig, Node dest){ // POSGAR = EPSG:4694 double dist; Point x,y; dist = -1; x = ((Point) orig.getObject()); y = ((Point) dest.getObject()); try { GeodeticCalculator gc = new GeodeticCalculator(CRS.decode("EPSG:4694)); gc.setStartingGeographicPoint(x.getX(),x.getY()); gc.setDestinationGeographicPoint(y.getX(), y.getY()); dist = gc.getOrthodromicDistance(); System.out.println("Distance between nodes in meter: "+ dist); }catch(Exception e){ e.printStackTrace(); } return dist; } Two problems arise: First, the one about EPSG:4694 not been recognized. Second, the one about the coordinates of points, which are incredible big numbers. What I am probably not understanding is what is the meaning of "projected coordinates", or how are coordinates projected. Anyway, I am trying to do just a simple operation of distance in meters, given the fact that I will need to tell blind people how to get from one place to another with my software. Thanks in advance Fran Justin Deoliveira-4 wrote: > > Hi Fran, > > I am not exactly sure I understand the problem. Working with the graph > in projected coordinates should work just fine, there should be no need > to transform the coordinates to lat/long, unless you have that > requirement. > > As for EPSG:4694, i notice that it is supported in recent version of > geotools: > > GEOGCS["POSGAR 94", > DATUM["Posiciones Geodesicas Argentinas 1994", > SPHEROID["GRS 1980", 6378137.0, 298.257222101, > AUTHORITY["EPSG","7019"]], > AUTHORITY["EPSG","6694"]], > PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], > UNIT["degree", 0.017453292519943295], > AXIS["Geodetic longitude", EAST], > AXIS["Geodetic latitude", NORTH], > AUTHORITY["EPSG","4694"]] > > Which version are you using? > > -Justin > > FranGM wrote: >> Hi there. >> I've got a shapefile of my city which a turned into a graph. Now I wanted >> to >> use a DijkstraShortestPathFinder. To create a weighter I want to find out >> the length of each edge of the graph (the orthodromic distance between >> its >> nodes). >> Each Node has a "getObject" method from where you can get a Point with >> coordinates. What I would like to know is how are this coordinates (big >> doubles with around 7 non decimal ciphers) related to "real coordinates" >> (lat/long). >> Thing is, my data seems to be in ARGENTINA POSGAR94, zone 4, datum WGS84 >> (as >> I can read in the readme file). I found over the net that this >> corresponds >> to EPSG:4694, but it seems that the GeodeticCalculator class does not >> know >> about it. >> In other words, I think I'm getting troubled with something that is >> probably >> easy. >> May anyone lend me a hand in this subject? >> >> Thanks in advance >> >> Fran >> > > > -- > Justin Deoliveira > The Open Planning Project > http://topp.openplans.org > > ------------------------------------------------------------------------- > 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/ > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://www.nabble.com/Graphs%2C-Nodes-and-Points.-Argentinian-Coordinates-tp14517968p14530330.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: Justin Deoliveira - 2007-12-28 20:20:18 ```Hmmm... I would suspect EPSG:4694 to be available on geotools 2.4 as well. Do you get an exception when youc all CRS.decode( "EPSG:4694" ) ? Do you one of the epsg "plugin" modules on your classpath? epsg-wkt or epsg-hsql? FranGM wrote: > Hi Justin. Thanks for your quick answer! > I'm currently using geotools 2.4 and I don't want to switch to 2.5 yet given > the fact that the project I'm on is to be used by the comunity of my city, > so I would like to work with the more stable possible version. > In this version, I tried to make a CRS.decode("EPSG:4694") but didn't > success. > What I am willing to do (the intentions at least) you can see it in this > little piece of non-working code: (you can say it is pseudo code) > > public double distance(Node orig, Node dest){ > // POSGAR = EPSG:4694 > double dist; > Point x,y; > dist = -1; > x = ((Point) orig.getObject()); > y = ((Point) dest.getObject()); > try { > GeodeticCalculator gc = new GeodeticCalculator(CRS.decode("EPSG:4694)); > gc.setStartingGeographicPoint(x.getX(),x.getY()); > gc.setDestinationGeographicPoint(y.getX(), y.getY()); > dist = gc.getOrthodromicDistance(); > System.out.println("Distance between nodes in meter: "+ dist); > }catch(Exception e){ > e.printStackTrace(); > } > return dist; > } > > Two problems arise: First, the one about EPSG:4694 not been recognized. > Second, the one about the coordinates of points, which are incredible big > numbers. > What I am probably not understanding is what is the meaning of "projected > coordinates", or how are coordinates projected. > Anyway, I am trying to do just a simple operation of distance in meters, > given the fact that I will need to tell blind people how to get from one > place to another with my software. > > Thanks in advance > > Fran > > > Justin Deoliveira-4 wrote: >> Hi Fran, >> >> I am not exactly sure I understand the problem. Working with the graph >> in projected coordinates should work just fine, there should be no need >> to transform the coordinates to lat/long, unless you have that >> requirement. >> >> As for EPSG:4694, i notice that it is supported in recent version of >> geotools: >> >> GEOGCS["POSGAR 94", >> DATUM["Posiciones Geodesicas Argentinas 1994", >> SPHEROID["GRS 1980", 6378137.0, 298.257222101, >> AUTHORITY["EPSG","7019"]], >> AUTHORITY["EPSG","6694"]], >> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], >> UNIT["degree", 0.017453292519943295], >> AXIS["Geodetic longitude", EAST], >> AXIS["Geodetic latitude", NORTH], >> AUTHORITY["EPSG","4694"]] >> >> Which version are you using? >> >> -Justin >> >> FranGM wrote: >>> Hi there. >>> I've got a shapefile of my city which a turned into a graph. Now I wanted >>> to >>> use a DijkstraShortestPathFinder. To create a weighter I want to find out >>> the length of each edge of the graph (the orthodromic distance between >>> its >>> nodes). >>> Each Node has a "getObject" method from where you can get a Point with >>> coordinates. What I would like to know is how are this coordinates (big >>> doubles with around 7 non decimal ciphers) related to "real coordinates" >>> (lat/long). >>> Thing is, my data seems to be in ARGENTINA POSGAR94, zone 4, datum WGS84 >>> (as >>> I can read in the readme file). I found over the net that this >>> corresponds >>> to EPSG:4694, but it seems that the GeodeticCalculator class does not >>> know >>> about it. >>> In other words, I think I'm getting troubled with something that is >>> probably >>> easy. >>> May anyone lend me a hand in this subject? >>> >>> Thanks in advance >>> >>> Fran >>> >> >> -- >> Justin Deoliveira >> The Open Planning Project >> http://topp.openplans.org >> >> ------------------------------------------------------------------------- >> 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/ >> _______________________________________________ >> Geotools-gt2-users mailing list >> Geotools-gt2-users@... >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> >> > -- Justin Deoliveira The Open Planning Project http://topp.openplans.org ```
 Re: [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: FranGM - 2007-12-28 20:58:31 ```Indeed. I am using the epsg-wkt. And the exception raises just when you say it does. In the call to the decode method: org.opengis.referencing.NoSuchAuthorityCodeException: Unknown EPSG_NUMBER I am also willing to change the plugin to the epsg-hsql because I've understanded it is more accurate. Any ideas? Fran Justin Deoliveira-4 wrote: > > Hmmm... I would suspect EPSG:4694 to be available on geotools 2.4 as > well. Do you get an exception when youc all CRS.decode( "EPSG:4694" ) ? > Do you one of the epsg "plugin" modules on your classpath? epsg-wkt or > epsg-hsql? > > > > FranGM wrote: >> Hi Justin. Thanks for your quick answer! >> I'm currently using geotools 2.4 and I don't want to switch to 2.5 yet >> given >> the fact that the project I'm on is to be used by the comunity of my >> city, >> so I would like to work with the more stable possible version. >> In this version, I tried to make a CRS.decode("EPSG:4694") but didn't >> success. >> What I am willing to do (the intentions at least) you can see it in this >> little piece of non-working code: (you can say it is pseudo code) >> >> public double distance(Node orig, Node dest){ >> // POSGAR = EPSG:4694 >> double dist; >> Point x,y; >> dist = -1; >> x = ((Point) orig.getObject()); >> y = ((Point) dest.getObject()); >> try { >> GeodeticCalculator gc = new GeodeticCalculator(CRS.decode("EPSG:4694)); >> gc.setStartingGeographicPoint(x.getX(),x.getY()); >> gc.setDestinationGeographicPoint(y.getX(), y.getY()); >> dist = gc.getOrthodromicDistance(); >> System.out.println("Distance between nodes in meter: "+ dist); >> }catch(Exception e){ >> e.printStackTrace(); >> } >> return dist; >> } >> >> Two problems arise: First, the one about EPSG:4694 not been recognized. >> Second, the one about the coordinates of points, which are incredible big >> numbers. >> What I am probably not understanding is what is the meaning of "projected >> coordinates", or how are coordinates projected. >> Anyway, I am trying to do just a simple operation of distance in meters, >> given the fact that I will need to tell blind people how to get from one >> place to another with my software. >> >> Thanks in advance >> >> Fran >> >> >> Justin Deoliveira-4 wrote: >>> Hi Fran, >>> >>> I am not exactly sure I understand the problem. Working with the graph >>> in projected coordinates should work just fine, there should be no need >>> to transform the coordinates to lat/long, unless you have that >>> requirement. >>> >>> As for EPSG:4694, i notice that it is supported in recent version of >>> geotools: >>> >>> GEOGCS["POSGAR 94", >>> DATUM["Posiciones Geodesicas Argentinas 1994", >>> SPHEROID["GRS 1980", 6378137.0, 298.257222101, >>> AUTHORITY["EPSG","7019"]], >>> AUTHORITY["EPSG","6694"]], >>> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], >>> UNIT["degree", 0.017453292519943295], >>> AXIS["Geodetic longitude", EAST], >>> AXIS["Geodetic latitude", NORTH], >>> AUTHORITY["EPSG","4694"]] >>> >>> Which version are you using? >>> >>> -Justin >>> >>> FranGM wrote: >>>> Hi there. >>>> I've got a shapefile of my city which a turned into a graph. Now I >>>> wanted >>>> to >>>> use a DijkstraShortestPathFinder. To create a weighter I want to find >>>> out >>>> the length of each edge of the graph (the orthodromic distance between >>>> its >>>> nodes). >>>> Each Node has a "getObject" method from where you can get a Point with >>>> coordinates. What I would like to know is how are this coordinates (big >>>> doubles with around 7 non decimal ciphers) related to "real >>>> coordinates" >>>> (lat/long). >>>> Thing is, my data seems to be in ARGENTINA POSGAR94, zone 4, datum >>>> WGS84 >>>> (as >>>> I can read in the readme file). I found over the net that this >>>> corresponds >>>> to EPSG:4694, but it seems that the GeodeticCalculator class does not >>>> know >>>> about it. >>>> In other words, I think I'm getting troubled with something that is >>>> probably >>>> easy. >>>> May anyone lend me a hand in this subject? >>>> >>>> Thanks in advance >>>> >>>> Fran >>>> >>> >>> -- >>> Justin Deoliveira >>> The Open Planning Project >>> http://topp.openplans.org >>> >>> ------------------------------------------------------------------------- >>> 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/ >>> _______________________________________________ >>> Geotools-gt2-users mailing list >>> Geotools-gt2-users@... >>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>> >>> >> > > > -- > Justin Deoliveira > The Open Planning Project > http://topp.openplans.org > > ------------------------------------------------------------------------- > 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/ > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://www.nabble.com/Graphs%2C-Nodes-and-Points.-Argentinian-Coordinates-tp14517968p14531398.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: FranGM - 2008-01-03 20:09:12 ```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: org.geotools gt2-epsg-hsql 2.4-SNAPSHOT 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 code to my city in this page: http://spatialreference.org/ref/epsg/ and 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]; tx.transform( projected, 0, longlat, 0, 1 ); After this routine, longlat will contain the longitude and latitude of the coordinate. /---------------------------------------------------------------------------------------------------------------------------------- 3. Use a GeodeticCalculator to get the distance between the points. Below I put a very initial version of my code (now working!). Thank you very much again and hope this helps someone else. Best regards! Fran import org.geotools.graph.structure.Node; import org.geotools.referencing.CRS; import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.operation.MathTransform; import org.geotools.graph.structure.*; import org.geotools.referencing.GeodeticCalculator; import com.vividsolutions.jts.geom.Point; public static double distance(Node orig, Node dest){ double dist; double[] longlat1, longlat2, projected1, projected2; Point p1,p2; CoordinateReferenceSystem crs1, crs2; MathTransform converter; dist = -1; p1 = ((Point) orig.getObject()); p2 = ((Point) dest.getObject()); longlat1 = new double[2]; longlat2 = new double[2]; try{ // Original coordinates, as you can get them from your graph proyectadas1 = new double[]{p1.getY(),p1.getX()}; proyectadas2 = new double[]{p2.getY(),p2.getX()}; // POSGAR 94 / Argentina 4: http://spatialreference.org/ref/epsg/22184/ crs1 = CRS.decode( "EPSG:22184" ); crs2 = CRS.decode( "EPSG:4326" ); converter = CRS.findMathTransform( crs1, crs2, true ); converter.transform( projected1, 0, longlat1, 0, 1 ); converter.transform( projected2, 0, longlat2, 0, 1 ); // geodetic distance calculator GeodeticCalculator gc = new GeodeticCalculator(CRS.decode("EPSG:22184")); gc.setStartingGeographicPoint(longlat1[1],longlat1[0]); gc.setDestinationGeographicPoint(longlat2[1],longlat2[0]); dist = gc.getOrthodromicDistance(); System.out.println("Distance: "+ dist); }catch(Exception e){ e.printStackTrace(); } return dist; } -- View this message in context: http://www.nabble.com/Graphs%2C-Nodes-and-Points.-Argentinian-Coordinates-tp14517968p14604338.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 Re: [Geotools-gt2-users] Graphs, Nodes and Points. Argentinian Coordinates From: Justin Deoliveira - 2008-01-03 23:17:04 ```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: > > org.geotools > gt2-epsg-hsql > 2.4-SNAPSHOT > > 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 > code to my city in this page: http://spatialreference.org/ref/epsg/ and > 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]; > tx.transform( projected, 0, longlat, 0, 1 ); > > After this routine, longlat will contain the longitude and latitude of > the coordinate. > /---------------------------------------------------------------------------------------------------------------------------------- > 3. Use a GeodeticCalculator to get the distance between the points. > > Below I put a very initial version of my code (now working!). Thank you very > much again and hope this helps someone else. > Best regards! > > Fran > > import org.geotools.graph.structure.Node; > import org.geotools.referencing.CRS; > import org.opengis.referencing.crs.CoordinateReferenceSystem; > import org.opengis.referencing.operation.MathTransform; > import org.geotools.graph.structure.*; > import org.geotools.referencing.GeodeticCalculator; > import com.vividsolutions.jts.geom.Point; > > public static double distance(Node orig, Node dest){ > double dist; > double[] longlat1, longlat2, projected1, projected2; > Point p1,p2; > CoordinateReferenceSystem crs1, crs2; > MathTransform converter; > dist = -1; > p1 = ((Point) orig.getObject()); > p2 = ((Point) dest.getObject()); > longlat1 = new double[2]; > longlat2 = new double[2]; > > try{ > // Original coordinates, as you can get them from your graph > proyectadas1 = new double[]{p1.getY(),p1.getX()}; > proyectadas2 = new double[]{p2.getY(),p2.getX()}; > // POSGAR 94 / Argentina 4: http://spatialreference.org/ref/epsg/22184/ > crs1 = CRS.decode( "EPSG:22184" ); > crs2 = CRS.decode( "EPSG:4326" ); > converter = CRS.findMathTransform( crs1, crs2, true ); > converter.transform( projected1, 0, longlat1, 0, 1 ); > converter.transform( projected2, 0, longlat2, 0, 1 ); > // geodetic distance calculator > GeodeticCalculator gc = new GeodeticCalculator(CRS.decode("EPSG:22184")); > gc.setStartingGeographicPoint(longlat1[1],longlat1[0]); > gc.setDestinationGeographicPoint(longlat2[1],longlat2[0]); > dist = gc.getOrthodromicDistance(); > System.out.println("Distance: "+ dist); > }catch(Exception e){ > e.printStackTrace(); > } > return dist; > } -- Justin Deoliveira The Open Planning Project http://topp.openplans.org ```
 [Geotools-gt2-users] FIDs and file name changes From: Parks, Aaron B. - 2008-01-09 19:57:41 ```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 ```
 Re: [Geotools-gt2-users] FIDs and file name changes From: Jody Garnett - 2008-01-09 23:09:48 ```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. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ```
 Re: [Geotools-gt2-users] FIDs and file name changes From: Parks, Aaron B. - 2008-01-10 00:58:55 ```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@...]=20 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=20 am afraid the FIDs more represent a selection on a single service (in=20 this case a file) rather than something abstract. If you had an ID=20 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. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketp lace > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > =20 ```
 Re: [Geotools-gt2-users] FIDs and file name changes From: Andrea Aime - 2008-01-10 07:51:05 ```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 ```
 Re: [Geotools-gt2-users] FIDs and file name changes From: Parks, Aaron B. - 2008-01-10 13:05:12 ```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. Thanks for all your help! Aaron Parks -----Original Message----- From: Andrea Aime [mailto:aaime@...]=20 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. >=20 > 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 ```
 Re: [Geotools-gt2-users] FIDs and file name changes From: Andrea Aime - 2008-01-10 13:19:12 ```Parks, Aaron B. ha scritto: > 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. Well, corner cases there are. The fid you get out of a shapefile is really . so if you delete any record of the shapefile every fid after that will change. Unfortuantely there is not much we can do about it, shapefile has no primary key concept, and the row number at least has the nice property of being fast to lookup. Cheers Andrea ```