From: Jody G. <jga...@re...> - 2006-02-10 08:06:49
|
vijethashenoy wrote: >Dear sir, > I wanted your help regarding how to use the geotools toolkit.I I wanted to know how to start studying the toolkit since it is very vast.We have only three months time to finish our project.We are doing map analysis using gis.Please help. > > Can you give me more clues? Are you analysing stream networks, or a siers of roads? Or breaking down the terrain interms of watersheds? (or political boundaries?). Analysing photos (called grid coverages in GIS)? Knowning nothing I would recommend you start with uDig, and look into the "opperations" api. It will let you do something on your data. And the applicaiton will take care of loading/saving and letting you run your opperations. Cheers, Jody |
From: Satyanarayana M. P. <sat...@re...> - 2006-10-11 08:44:58
|
hi guys ,Can someone please send me the link to unsubscribe from this mail-list.I am no longer in a similar project and am not active in this group.Thanks,Regards,Satya. |
From: <aa...@op...> - 2006-10-11 09:34:39
|
Satyanarayana Murty Pindiproli ha scritto: > hi guys , > Can someone please send me the link to unsubscribe from this mail-list. > I am no longer in a similar project and am not active in this group. Ever seen what's at the bottom of all the mails in this list? Geotools-gt2-users mailing list Geo...@li... https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users Use this link to unsuscribe :-) Cheers Andrea |
From: D.J. Z. <zha...@gm...> - 2006-12-04 16:21:29
|
Hi All, I am a new user to the list. I got two problems about geotools that have been bothering me for a while. But they may all solved in the new version. Could anyone give me some info about these? I am using Geotools 2.1.0. My first problem is that MaxScaleDenominator doesn't work for me. I tried a very simple test, to either or not render a road according to the zoom levels. I tried by using both Java coding and SLD, but MaxScaleDenominator just doesn't seem to work. Similarly filter also doesn't work for me. One simple filter example I have tried is the distance filter to find a feature close to a point. And it doesn't work either. I am not sure whether these are bugs in version 2.1.0 or I didn't do it in the right way. Are these functions working in the current version? My second question is road's label rendering - all the labels are rendered horizontally. But ideally I want the labels to be rendered by aligning the road direction, and close to and on the road. How should I do to achieve these? Which geotools version support these features? thank you, Dejin |
From: Govardhan <gov...@co...> - 2007-01-29 10:08:57
|
Dear Jody Garnette, I want to create a line feature, on the mapLayer, which I am able to = do, but I want to create the=20 line with a style, which should contain Arrow mark in it as show below.. ----->----->--------->---------->-------- But I am not sure how to achieve this kind of style object for the line. Can you please help me in doing this.... Best Regards Govardhan |
From: Fernando C. <fer...@ya...> - 2007-06-05 14:58:57
|
Hello Andrea, I'm here again. I was using only one rule to the TextSymbolizer and it was runing OK but I want to simulate a zoom for the text. I was trying to use a diferents rules to the same datafield acording to the zoom level for example: <sld:Rule> <sld:MinScaleDenominator> 80000 </sld:MinScaleDenominator> <sld:MaxScaleDenominator> 520000000 </sld:MaxScaleDenominator> <sld:TextSymbolizer> <sld:Label> <ogc:PropertyName>nmvia</ogc:PropertyName> </sld:Label> <sld:Font> <sld:CssParameter name="font-size"> <ogc:Literal>10.0</ogc:Literal> </sld:CssParameter> </sld:Font> </sld:TextSymbolizer> </sld:Rule> <sld:Rule> <sld:MinScaleDenominator> 5200000001 </sld:MinScaleDenominator> <sld:MaxScaleDenominator> 52000000000 </sld:MaxScaleDenominator> <sld:TextSymbolizer> <sld:Label> <ogc:PropertyName>nmvia</ogc:PropertyName> </sld:Label> <sld:Font> <sld:CssParameter name="font-size"> <ogc:Literal>18.0</ogc:Literal> </sld:CssParameter> </sld:Font> </sld:TextSymbolizer> </sld:Rule> The computer begins to read the hard disk and don't stop. I want to restart the computer. I want to know how the TextSymbolizer is drawing? Here we are thinking in create a class to draw the text in a vector way like a polygon then we can apply the zoom. What do you think??? Thank you again Fernando ____________________________________________________________________________________ Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting |
From: <tcm...@cr...> - 2007-06-05 17:42:53
|
Hi all, I am newcomer to geotools. I am trying to create a WFS client using = getools api. Based on the WFSDataStore examples I have successfully obtained the data from a WFS. I am now trying to access the =93meta-information=94 = describing the WFS, i.e: <Service> <Name>MapServer WFS</Name> <Title>Environment Canada - Pacific and Yukon Region - Water Quality Monitoring Program - WFS</Title> <Abstract>Pacific and Yukon Region's long term water quality monitoring stations</Abstract> ... Unfortunately I am able to extract this information from the data store. = How can I access it? Thanks Tiago |
From: Jody G. <jga...@re...> - 2007-06-05 21:24:13
|
That kind of thing is not available via the data store api. You can get it from the catalog handle - if you were using a catalog. - http://docs.codehaus.org/display/GEOTDOC/Managing+DataStores+using+Repository+or+Catalog (Near the end of the page) Wait perhaps there is a getCapabilities method on the WFSDataStore itself ... nope but the field is there. You would need to subclass to access it. Jody > Hi all, > > I am newcomer to geotools. I am trying to create a WFS client using getools > api. Based on the WFSDataStore examples I have successfully obtained the > data from a WFS. I am now trying to access the “meta-information” describing > the WFS, i.e: > > <Service> > <Name>MapServer WFS</Name> > <Title>Environment Canada - Pacific and Yukon Region - Water Quality > Monitoring Program - WFS</Title> > <Abstract>Pacific and Yukon Region's long term water quality > monitoring stations</Abstract> > ... > > Unfortunately I am able to extract this information from the data store. How > can I access it? > > Thanks > Tiago > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |
From: <tcm...@cr...> - 2007-06-06 09:19:32
|
Hi Jody, I remember this page about the catalogue from my previous question. Back then you told me that it isn't "stable" enough and that I should stick = to the datastore API for now. It seems the catalogue will be quite an improvement for these issues (metadata, etc) do you feel that it is better to adopt it has it is now = than subclassing WFSDataStore? Thanks for all the help Tiago -----Original Message----- From: Jody Garnett [mailto:jga...@re...]=20 Sent: ter=E7a-feira, 5 de Junho de 2007 22:24 To: Tiago Sim=F5es Cc: geo...@li... Subject: Re: [Geotools-gt2-users] Accessing WFS meta information (title, name, abstract, etc) That kind of thing is not available via the data store api. You can get=20 it from the catalog handle - if you were using a catalog. -=20 http://docs.codehaus.org/display/GEOTDOC/Managing+DataStores+using+Reposi= tor y+or+Catalog (Near the end of the page) Wait perhaps there is a getCapabilities method on the WFSDataStore=20 itself ... nope but the field is there. You would need to subclass to=20 access it. Jody > Hi all, > > I am newcomer to geotools. I am trying to create a WFS client using getools > api. Based on the WFSDataStore examples I have successfully obtained = the > data from a WFS. I am now trying to access the =93meta-information=94 describing > the WFS, i.e: > > <Service> > <Name>MapServer WFS</Name> > <Title>Environment Canada - Pacific and Yukon Region - Water Quality > Monitoring Program - WFS</Title> > <Abstract>Pacific and Yukon Region's long term water quality > monitoring stations</Abstract> > ... > > Unfortunately I am able to extract this information from the data = store. How > can I access it? > > Thanks > Tiago > > > = -------------------------------------------------------------------------= > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > =20 |
From: Jody G. <jga...@re...> - 2007-06-06 18:53:56
|
I am afraid you are damed if you do and dammed if you don't :-( Let's think - we could ask for a getCapabilities() method on WFSDataStore. It would need to take a ProgressListener .... so getCapabilities( ProgessListener ). Just going to check if the actual Capabilities object is public ... yes it is a public class WFSCapabilities. Bleck - let's ask for Justin's input (he ported the catalog code over from uDig to GeoTools). If I were you I would use catalog right now (since you *can* use it right now) - and then plan to change that section of your code when GeoServer has figured out what it wants to see ... As far as I understand GeoServer would like to see: WFSService.getAbstract() Rather than: IService.getInfo( null ).getAbstract() If justin is actually planning to change things soon (ie in the next month) then we can make a bug report requesting WFSDataStore.getCapabilities( progressListener ). Cheers, Jody > Hi Jody, > > I remember this page about the catalogue from my previous question. Back > then you told me that it isn't "stable" enough and that I should stick to > the datastore API for now. > > It seems the catalogue will be quite an improvement for these issues > (metadata, etc) do you feel that it is better to adopt it has it is now than > subclassing WFSDataStore? > > Thanks for all the help > Tiago > |
From: <je...@ha...> - 2007-06-13 04:37:12
|
Hi All, I'm a geotools newbie, but I've setup geoserver and am querying it via wfs. I've created a client application using geotools 2.2.4 (I did not find it easy from scratch with the doco thats available), I construct a filter and add it to a query from which I get results. the trouble is that the query only ever sends a this query and never includes my filter (it does use maxFeatures and typeName settings though). eg: from serverlog - <?xml version="1.0" encoding="UTF-8"?> <GetFeature xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net /gml" xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0" service="WFS" outpu tFormat="GML2" maxFeatures="10"><Query typeName="sde:TOPO.GAZETTEER"></Query> </GetFeature> the filter does get used - but its run clientside. how can I force geotools to send a complete wfs query to the server? grabbing all that data from the server for clientside processing is very slow. Thanks Jason. |
From: ELENA B. <ele...@st...> - 2007-07-03 09:51:35
|
Hello all, I'd have a question about shape files I wish you can resolve: I have to do a java program which reads some coordinates of points from a file (for exemple csv or txt files) and creates 3 files: .shp, .shx and .dbf (dbf contains informations relative to each point). I haven't understood what I can download for my purpose, and if there is all I need for my work already ready in the web site. Can you help me?, because it's very urgent! Thanks, Elena. |
From: Jody G. <jga...@re...> - 2007-08-30 14:51:47
|
Hi Elena the user guide has instructions on how to create a shapefile and add features... I would love your feedback as you try them out. - http://docs.codehaus.org/display/GEOTDOC/05+How+to+Write+a+Shapefile Next time you email the list you should include a subject line (otherwise spam filters remove your message). ELENA BELLODI wrote: > Hello all, > I'd have a question about shape files I wish you can resolve: I have to do > a java program which reads some coordinates of points from a file (for > exemple csv or txt files) and creates 3 files: .shp, .shx and .dbf (dbf > contains informations relative to each point). I haven't understood > what I can download for my purpose, and if there is all I need for my work > already ready in the web site. > Can you help me?, because it's very urgent! > > Thanks, > Elena. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |
From: <gio...@ti...> - 2007-07-20 11:48:00
|
Hi everyone. I work with geotools 2.3.2. I must show a giff image and I should make a zoom . Have you got an=20 java example that help me. ____________________________________________________________ TISCALI TANDEM FLAT Stacca Telecom: telefono e Adsl 10 MB a =E2=82=AC 39.95. GRATIS modem, attivazione e seconda linea telefonica! http://abbonati.tiscali.it/adsl/prodotti/tc/tandemflat_tel/ |
From: Jody G. <jga...@re...> - 2007-08-30 14:53:02
|
We mostly work on the drawing the image part; saving to gif and building a zoom widget we leave for others. There is an "unsupported" JMapPane module you can try out for the zoom part of it - and there is lots of examples of how to use JAI to write out a GIF. Jody > Hi everyone. > > I work with geotools 2.3.2. > I must show a giff image and I should make a zoom . Have you got an > java example that help me. > > > ____________________________________________________________ > TISCALI TANDEM FLAT > Stacca Telecom: telefono e Adsl 10 MB a € 39.95. > GRATIS modem, attivazione e seconda linea telefonica! > http://abbonati.tiscali.it/adsl/prodotti/tc/tandemflat_tel/ > > > > ------------------------------------------------------------------------- > 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 > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |
From: Julian H. <Jul...@gm...> - 2008-09-08 14:25:13
|
Hi mailinglist, sorry for my second post today, but it seems, that i can not solve my problem, without a hint of the pros :-) Here it is: I am building a custom class from DuplicatingStlyeVisitor: public class CustomStyleVisitor extends DuplicatingStyleVisitor { public CustomStyleVisitor( Expression exp ) { this.exp = exp; } public void visit(TextSymbolizer text) { Fill fill = update(text.getFill()); Font[] font = text.getFonts(); Halo halo = text.getHalo(); Expression label = exp; LabelPlacement placement = text.getLabelPlacement(); String geometryPropertyName = text.getGeometryPropertyName(); TextSymbolizer copy = sf.createTextSymbolizer( fill, font, halo, label, placement, geometryPropertyName ); pages.push(copy); } Fill update( Fill fill ) { Expression color = ff.literal("#000000"); if( ff.less( exp, ff.literal(1.0) ).evaluate( null ) ) // does not work :-((((((( color = ff.literal("#00FF00"); Expression opacity = fill.getOpacity(); return sf.createFill( color, opacity ); } } And this is how i am using this visitor: . . . CustomStyleVisitor osv = new CustomStyleVisitor( ff.property("num_val") ); areaStyle.accept(osv); areaStyle = (Style)osv.getCopy(); . . . What i want to do is, drawing the labels of the feature, depending on their property 'num_val'. If it is smaller than 1, the labels should be drawn green, else black. The problem seems to be, that i can't not evaluate the lesser-relation of the filterfactory, without the referring feature of the expression. Is there a way around that? Am i overseeing something? Sincerely, Julian -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser |
From: Jody G. <jga...@re...> - 2008-09-08 17:12:28
|
Julian Hagenauer wrote: > Fill update( Fill fill ) { > Expression color = ff.literal("#000000"); > if( ff.less( exp, ff.literal(1.0) ).evaluate( null ) ) // does not work :-((((((( > color = ff.literal("#00FF00"); > Expression opacity = fill.getOpacity(); > return sf.createFill( color, opacity ); > } > > CustomStyleVisitor osv = new CustomStyleVisitor( ff.property("num_val") ); > areaStyle.accept(osv); > areaStyle = (Style)osv.getCopy(); > . > . > . > > What i want to do is, drawing the labels of the feature, depending on their property 'num_val'. > Cool - create a Rule to select only those features; and then use your Fill as normal. > If it is smaller than 1, the labels should be drawn green, else black. > Right so you will need two Rules; one for each set of Features; each Rule will have different symbolizers. Note on SE 1.1. there is a categorization function (I implemented it on trunk if you want to use it now) that can offer a lookup based on a value ...but using a Rule is going to be so much faster as it will be able to perform a nice optimized SQL query. > The problem seems to be, that i can't not evaluate the lesser-relation of the filterfactory, without the referring feature of the expression. > Correct; this is a test you want to perform on a feature by feature basis; the SLD document lets you declair up front what rules to use; and then the correct styles are used based on the individual features. > Is there a way around that? Am i overseeing something? > Rule :-) |
From: Julian H. <Jul...@gm...> - 2008-09-09 09:03:33
|
Hi, thank you. I should have known that by myself. One question thought: To sum it up, i want to modify an existing style depending on a numerical value, e.g. i want to draw the feature's label depending on expression exp. Can you give me a hint, how i can implement that? Should i actually use a DuplicatingStyleVisitor? This is, what i am doing for know: public void visit( Rule rule ) { Symbolizer[] symbolizer = rule.getSymbolizers(); DuplicatingStyleVisitor dsv = new DuplicatingStyleVisitor(); for( int i = 0; i < symbolizer.length; i++ ) if( symbolizer[i] instanceof TextSymbolizer ) { symbolizer[i].accept( dsv ); TextSymbolizer ts = (TextSymbolizer)dsv.getCopy(); ts.setLabel(ff.literal("exp less than 0.5")); symbolizer[i] = ts; } Rule copy = sf.createRule(); copy.setFilter( ff.less( exp, ff.literal( 0.5 ) ) ); copy.setSymbolizers( symbolizer ); pages.push(copy); } The problem is: How can i add an else-rule or multiplie rules to the visitor? Is there a better way in adding rules? Thank you very much. Sincerely, Julian -------- Original-Nachricht -------- > Datum: Mon, 08 Sep 2008 10:12:34 -0700 > Von: Jody Garnett <jga...@re...> > An: Julian Hagenauer <Jul...@gm...> > CC: geo...@li... > Betreff: Re: [Geotools-gt2-users] (no subject) > Julian Hagenauer wrote: > > Fill update( Fill fill ) { > > Expression color = ff.literal("#000000"); > > if( ff.less( exp, ff.literal(1.0) ).evaluate( null ) ) // does not > work :-((((((( > > color = ff.literal("#00FF00"); > > Expression opacity = fill.getOpacity(); > > return sf.createFill( color, opacity ); > > } > > > > > CustomStyleVisitor osv = new CustomStyleVisitor( ff.property("num_val") > ); > > areaStyle.accept(osv); > > areaStyle = (Style)osv.getCopy(); > > . > > . > > . > > > > What i want to do is, drawing the labels of the feature, depending on > their property 'num_val'. > > > Cool - create a Rule to select only those features; and then use your > Fill as normal. > > If it is smaller than 1, the labels should be drawn green, else black. > > > Right so you will need two Rules; one for each set of Features; each > Rule will have different symbolizers. > > Note on SE 1.1. there is a categorization function (I implemented it on > trunk if you want to use it now) that can offer a lookup based on a > value ...but using a Rule is going to be so much faster as it will > be able to perform a nice optimized SQL query. > > The problem seems to be, that i can't not evaluate the lesser-relation > of the filterfactory, without the referring feature of the expression. > > > Correct; this is a test you want to perform on a feature by feature > basis; the SLD document lets you declair up front what rules to use; and > then the correct styles are used based on the individual features. > > Is there a way around that? Am i overseeing something? > > > Rule :-) -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser |
From: Jody G. <jga...@re...> - 2008-09-09 19:26:23
|
Julian Hagenauer wrote: > To sum it up, i want to modify an existing style depending on a numerical value, e.g. i want to draw the feature's label depending on expression exp. > That is fine ... I think I am asking you to do something differently. Define a complete style that has several rules; each rule will handle some of the features. Ie please define your Style to reflect what you want to see. There is no need to copy or modify anything ... you could even be reading in an XML file and changing this stuff in a text editor. You Named Style - Rule #1 only enganged when CQL.toFiler("EXP < 0.5") -- symbolizers saying how you want this stuff drawn - Rule #2 with filter CQL.toFilter( "EXP >= 0.5 ) -- symbolizers saying how you want this stuff drawn - Rule with no filter is an "else" rule -- symbolizers saying how you want this stuff drawn > Can you give me a hint, how i can implement that? > Should i actually use a DuplicatingStyleVisitor? > This is, what i am doing for know: > > public void visit( Rule rule ) { > Symbolizer[] symbolizer = rule.getSymbolizers(); > DuplicatingStyleVisitor dsv = new DuplicatingStyleVisitor(); > for( int i = 0; i < symbolizer.length; i++ ) > if( symbolizer[i] instanceof TextSymbolizer ) { > symbolizer[i].accept( dsv ); > TextSymbolizer ts = (TextSymbolizer)dsv.getCopy(); > ts.setLabel(ff.literal("exp less than 0.5")); > symbolizer[i] = ts; > } > Rule copy = sf.createRule(); > copy.setFilter( ff.less( exp, ff.literal( 0.5 ) ) ); > copy.setSymbolizers( symbolizer ); > pages.push(copy); > } > > The problem is: How can i add an else-rule or multiplie rules to the visitor? Is there a better way in adding rules? > I see you are trying to modify a style that some user has already provided you in a systematic way? If they provided it to you in XML you could use XSLT prior to parsing it in. If not your approach is okay; but I think you want to write all your logic at the visit( FeatureTypeStyle ) method - because that is a code that has a list of Rules for you to add and manipulate. Jody |
From: Julian H. <jul...@gm...> - 2008-09-10 15:28:24
|
Am Tue, 09 Sep 2008 12:26:34 -0700 schrieb Jody Garnett <jga...@re...>: > If not your approach is okay; but > I think you want to write all your logic at the visit( FeatureTypeStyle > ) method - because that is a code that has a list of Rules for you to > add and manipulate. Thank you. I have should known that by myself. I want to dynamically modify the map appearance in dependency to the user's iteraction, therefore i needed to modify the style "inline". Sincerely, Julian |
From: Aengus M. <aen...@ne...> - 2008-10-21 14:32:25
|
Paulo, The structure of a shapefile (.shp .dbf .shx) is described in : http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf Feature isn't deprecated in 2.5.0, make sure it is a org.geotools.feature.Feature and not some other kind of feature. Hope this helps, Aengus |
From: yako y. <ya...@ho...> - 2009-04-16 13:01:19
|
Hi, I don't understand why my FeaturesSources linked to a WFS-T Server (Geoserver) are not FeatureStores. Here is my code Map<String, Object> connectionParameters = new HashMap<String, Object>(); connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", "http://localhost:8090/geoserver/wfs?REQUEST=GetCapabilities"); DataStore ds = DataStoreFinder.getDataStore(connectionParameters); FeatureSource fs = ds.getFeatureSource("mynamespace:roads"); if(fs == null) { System.out.println("is null"); } else if(fs instanceof FeatureStore) { System.out.println("is instance of FeatureStore"); } else { System.out.println("is not instance of FeatureStore"); } It displays "is not instance of FeatureStore". Can somebody helps me? Thank you, Yako Bak _________________________________________________________________ Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant ! http://www.windowslive.fr/messenger/1.asp |
From: Jody G. <jod...@gm...> - 2009-04-17 02:47:19
|
Because you connected using WFS-1.1; and GeoTools does not support WFS-T using 1.1. If you add VERSION=1.0 to your capabilities URL you should be good to go. Jody On Thu, Apr 16, 2009 at 11:01 PM, yako yako <ya...@ho...> wrote: > Hi, > > I don't understand why my FeaturesSources linked to a WFS-T Server > (Geoserver) are not FeatureStores. > > Here is my code > > Map<String, Object> connectionParameters = new HashMap<String, Object>(); > connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", > "http://localhost:8090/geoserver/wfs?REQUEST=GetCapabilities"); > DataStore ds = DataStoreFinder.getDataStore(connectionParameters); > FeatureSource fs = ds.getFeatureSource("mynamespace:roads"); > if(fs == null) > { > System.out.println("is null"); > } > else if(fs instanceof FeatureStore) > { > System.out.println("is instance of FeatureStore"); > } > else > { > System.out.println("is not instance of FeatureStore"); > } > > It displays "is not instance of FeatureStore". > > Can somebody helps me? > > Thank you, > > Yako Bak > > ________________________________ > Discutez sur Messenger où que vous soyez ! Mettez Messenger sur votre mobile > ! > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > |
From: yako y. <ya...@ho...> - 2009-04-17 09:06:30
|
It works, Thank you Jody! Now, I come to another problem : Date parsing fails when I add a feature to Geoserver. here is my code : String startDateString = "28/04/2009"; String endDateString = "29/04/2009"; DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); java.util.Date startDate = null; java.util.Date endDate = null; try { startDate = (Date)formatter.parse(startDateString); endDate = (Date)formatter.parse(endDateString); } catch (ParseException e) { e.printStackTrace(); } FeatureStore<SimpleFeatureType,SimpleFeature> fs = getFeatureStore("roads"); GeometryFactory geomFactory = new GeometryFactory(); Point point = geomFactory.createPoint( new Coordinate(0, 0)); FeatureCollection<SimpleFeatureType, SimpleFeature> collection = FeatureCollections.newCollection("internal"); final SimpleFeature feature = SimpleFeatureBuilder.build( fs.getSchema(), new Object[] {new java.sql.Timestamp(startDate.getTime()), new java.sql.Timestamp(endDate.getTime()), "bla bla", point}, null ); collection.add(feature); fs.addFeatures(collection); and here is the stack trace : 17 avr. 2009 11:02:22 org.geotools.xml.XMLSAXHandler processException GRAVE: java.lang.RuntimeException: Parsing failed for date_debut: java.lang.IllegalArgumentException: Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 Parsing failed for date_debut: java.lang.IllegalArgumentException: Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 org.geotools.xml.filter.FilterComplexTypes$ServiceExceptionType.getValue(FilterComplexTypes.java:1669) org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:157) org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:266) org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XMLParser.parse(Unknown Source) org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) javax.xml.parsers.SAXParser.parse(SAXParser.java:395) javax.xml.parsers.SAXParser.parse(SAXParser.java:198) org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140) org.geotools.data.wfs.v1_0_0.WFSTransactionState.commitPost(WFSTransactionState.java:298) org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:152) org.geotools.data.wfs.v1_0_0.WFSFeatureStore.addFeatures(WFSFeatureStore.java:178) mypackage.CommandHandler.handleCommand(CommandHandler.java:230) mypackage.CommandHandler.doPost(CommandHandler.java:87) javax.servlet.http.HttpServlet.service(HttpServlet.java:647) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:619) 17 avr. 2009 11:02:22 org.geotools.xml.XMLSAXHandler endElement ATTENTION: java.lang.RuntimeException: Parsing failed for date_debut: java.lang.IllegalArgumentException: Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 Parsing failed for date_debut: java.lang.IllegalArgumentException: Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 17 avr. 2009 11:02:22 org.geotools.xml.XMLSAXHandler endElement ATTENTION: Line 11 Col 20 17 avr. 2009 11:02:22 org.geotools.data.wfs.v1_0_0.WFSTransactionState commit ATTENTION: org.geotools.ows.ServiceException: java.lang.RuntimeException: Parsing failed for date_debut: java.lang.IllegalArgumentException: Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 Parsing failed for date_debut: java.lang.IllegalArgumentException: Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 Failed to parse dateTime 2009-04-28 00:00:00.0 at: 00:00:00.0 > Date: Fri, 17 Apr 2009 12:47:03 +1000 > Subject: Re: [Geotools-gt2-users] (no subject) > From: jod...@gm... > To: ya...@ho... > CC: geo...@li... > > Because you connected using WFS-1.1; and GeoTools does not support > WFS-T using 1.1. > > If you add VERSION=1.0 to your capabilities URL you should be good to go. > > Jody > > On Thu, Apr 16, 2009 at 11:01 PM, yako yako <ya...@ho...> wrote: > > Hi, > > > > I don't understand why my FeaturesSources linked to a WFS-T Server > > (Geoserver) are not FeatureStores. > > > > Here is my code > > > > Map<String, Object> connectionParameters = new HashMap<String, Object>(); > > connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", > > "http://localhost:8090/geoserver/wfs?REQUEST=GetCapabilities"); > > DataStore ds = DataStoreFinder.getDataStore(connectionParameters); > > FeatureSource fs = ds.getFeatureSource("mynamespace:roads"); > > if(fs == null) > > { > > System.out.println("is null"); > > } > > else if(fs instanceof FeatureStore) > > { > > System.out.println("is instance of FeatureStore"); > > } > > else > > { > > System.out.println("is not instance of FeatureStore"); > > } > > > > It displays "is not instance of FeatureStore". > > > > Can somebody helps me? > > > > Thank you, > > > > Yako Bak > > > > Geotools-gt2-users mailing list > > Geo...@li... > > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > _________________________________________________________________ Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous ! http://www.microsoft.com/windows/windowslive/default.aspx |
From: Jody G. <jod...@gm...> - 2009-04-21 02:00:53
|
Date handling is always a mess; please look at the XML specifications for what ever iso format is used to communicates dates between systems (I cannot remember). Or check the geotools codebase where there is some date formatting/handling functions that can be used. Can you try just using your Date objects directly? Jody |