From: philippe.suray <phi...@ma...> - 2005-06-03 12:21:19
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hello,<br> <br> I've tried Luca's method and it works with ShapeFile.<br> <br> Thanks<br> <br> <pre class="moz-signature" cols="72">-- Suray Philippe _______________________________ Market-IP Boulevard de la Meuse, 10 B - 5100 Jambes T: 32 81 33.11.11 F: 32 81 33.11.10</pre> <br> <br> Chris Holmes wrote: <blockquote cite="mid...@we..." type="cite"> <pre wrap="">Did you try using Luca's method? It _should_ work - basically we made access to such things more generic. If it doesn't work with shapefile then it's a bug - make a JIRA task for it, against 2.1.0, since it really should be in the release. Chris </pre> <blockquote type="cite"> <pre wrap="">Hello, In fact, i've develop a small batch to import shape into MySQL 4.1. I need a 'getFieldLength()' method in order to create SQL CREATE statement (e.a create table network (name varchar(70), ...). It could be usefull to add a convenience method to access this information or access the metadata of the dbf. Thank you to take care of our suggestions. Regards -- Suray Philippe _______________________________ Market-IP Boulevard de la Meuse, 10 B - 5100 Jambes T: 32 81 33.11.11 F: 32 81 33.11.10 David Zwiers wrote: This was done to provide a more consistent method so specify restrictions (length was being used semantically for different operations on different datastores). If people are missing these, perhaps we should consider adding some utility methods (like the one below) for common use cases. I would consider adding them to the FeatureTypes class ... or new utility class called AtributeTypes. David On 6/1/05, Luca Sigfrido Percich <a class="moz-txt-link-rfc2396E" href="mailto:luc...@am..."><luc...@am...></a> wrote: Well, you're not the one who misses this handy method... Here is a workaround: private int getFieldLength(AttributeType attr, int defaultLength) { int length = -1; Filter f = attr.getRestriction(); if(f !=null && f!=Filter.ALL && f != Filter.NONE && (f.getFilterType() == f.COMPARE_LESS_THAN || f.getFilterType() == f.COMPARE_LESS_THAN_EQUAL)){ try{ CompareFilter cf = (CompareFilter)f; if(cf.getLeftValue() instanceof LengthFunction){ length = Integer.parseInt(((LiteralExpression)cf.getRightValue()).getLiteral(). toString()); }else{ if(cf.getRightValue() instanceof LengthFunction){ length = Integer.parseInt(((LiteralExpression)cf.getLeftValue()).getLiteral().t oString()); } } }catch(NumberFormatException e){ length = defaultLength; } }else{ length = defaultLength; } return length; } On 1 Jun 2005 at 9:38, philippe.suray wrote: Hello, Is it possible to have a response about getFieldLength() in AttributeType? This method does not exist any more, how can i do to obtain this information in 2.1M5 ? Thank you. -- Suray Philippe _______________________________ Market-IP Boulevard de la Meuse, 10 B - 5100 Jambes T: 32 81 33.11.11 F: 32 81 33.11.10 ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit <a class="moz-txt-link-freetext" href="http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005">http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005</a> _______________________________________________ Geotools-gt2-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Geo...@li...">Geo...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users">https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</a> -- Luca Sigfrido Percich (<a class="moz-txt-link-abbreviated" href="mailto:luc...@am...">luc...@am...</a>) Agenzia Milanese Mobilità e Ambiente s.r.l. (<a class="moz-txt-link-freetext" href="http://www.ama-mi.it">http://www.ama-mi.it</a>) Direzione Sistemi Informativi e Modellistica Via Beccaria, 19 - 20122 Milano - tel. +39 02 884.67.262 ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit <a class="moz-txt-link-freetext" href="http://developer.yahoo.net/?froffad-ysdn-ostg-q22005">http://developer.yahoo.net/?froffad-ysdn-ostg-q22005</a> _______________________________________________ Geotools-gt2-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Geo...@li...">Geo...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users">https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</a> ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit <a class="moz-txt-link-freetext" href="http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005">http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005</a> _______________________________________________ Geotools-gt2-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Geo...@li...">Geo...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users">https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</a> </pre> </blockquote> <pre wrap=""><!----> ---------------------------------------------------------- This mail sent through IMP: <a class="moz-txt-link-freetext" href="https://webmail.limegroup.com/">https://webmail.limegroup.com/</a> ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit <a class="moz-txt-link-freetext" href="http://developer.yahoo.net/?fr=fad-ysdn-ostg-q22005">http://developer.yahoo.net/?fr=fad-ysdn-ostg-q22005</a> _______________________________________________ Geotools-gt2-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Geo...@li...">Geo...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users">https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</a> </pre> </blockquote> <br> <pre class="moz-signature" cols="72"> </pre> </body> </html> |