Re: [Geotools-gt2-users] writing shapefile problem

2011-10-11 Thread Michael Bedward
Great to hear that you found the cause of the problem. Thanks very much for posting it to the list - it's good to have ones like this in the archives. Michael On 12 October 2011 03:34, filippov70 wrote: > I solved the problem. > were too long strings in russian language are to record in the DBF

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-11 Thread filippov70
I solved the problem. were too long strings in russian language are to record in the DBF Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 253 at java.lang.StringBuffer.charAt(StringBuffer.java:179) at org.geoto

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread filippov70
Thank you very much, your assistance conditional has been very helpful to me. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/writing-shapefile-problem-tp6846785p6879547.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ---

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread Michael Bedward
No idea - sorry. I haven't experienced this error in my own work and don't recall it being reported previously. Since neither Jody or I have been able to help you so far all I can suggest is for you to track the writing of a feature to shapefile with your debugger and see if you can isolate the p

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread filippov70
Thank you for the visualization of my data. But I did not add such polygons in SimpleFeatureCollection: mp = new MultiPolygon (pa, geometryFactory); if (mp.isValid ()) { parcelBuilder.add ("Polygon"); parc

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread Michael Bedward
Hello, That polygon has a self-intersecting outer shell. This image shows the lower (southern) end of the polygon. There is a vertex way off to the north-west that is causing the problem... http://imagebin.org/178408 Michael On 10 October 2011 20:56, filippov70 wrote: > Yes, some multipolygon

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread filippov70
Yes, some multipolygons not valid. Here they are: MULTIPOLYGON (((2283017.17 519163.53, 2283148.29 519197.73, 2283148.29 519197.73, 2283201.92 519264.53, 2283201.92 519264.53, 2283248.03 519284.69, 2283248.03 519284.69, 228.15 519306.07, 228.15 519306.07, 2283375.37 519329.65, 2283375.37 51

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread Michael Bedward
Perhaps you could post the WKT representation of one of the Polygons that you think is causing the problem. Then I, or others here, might be able to spot what is going on. If you are not certain which are the problem polygons you could also try calling the isValid() method on each of them. Michae

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread filippov70
Obviously, now I'm using polygon to determine the area. But the problem is not solved, all the same error. Occurs when a written shapefile that contains the polygon which contains a hole. Current fid index is null, next must be called before write() Откат изменений в shapefile, но файл создан. St

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-10 Thread Michael Bedward
Hello, A LinearRing will always have an area of 0 because it is linear, not polygonal. Having the start and end coordinates the same gives you a closed ring but unless you create a Polygon or MultiPolygon with it you still just have a line. Michael On 10 October 2011 17:39, filippov70 wrote: >

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-09 Thread filippov70
Hi! I understand the problem. In the source file "holes" in the polygon, as well as the shell is not in order, for example, the coordinates of the shell did not go to the beginning of the description of the landfill. I decided to determine the maximum area among all of the Rings: double maxArea =

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread filippov70
I will try to recreate this bug, test files > 500 pieces! Previously, this problem was for me, as I mistakenly assigned CRS (/ / newDataStore.forceSchemaCRS (CRS.decode ("EPSG: 28 415 "));) in ShapefileDataStore. Thank you for indication of errors in syntax, of course, is a local variable. Thank

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread Jody Garnett
So yeah it comes back to your actual data; I think some of it may be causing trouble? Put a break point in the commit() method and see if you can look at the feature that is causing the trouble? Aside: SimpleFeatureSource ParcelfeatureSource = polygonDataStore.getFeatureSource (ParcelTypeName

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread filippov70
Interestingly, I have not changed anything, has launched a project as usual and works! While tested on three original XML-files... -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/writing-shapefile-problem-tp6846785p6853952.html Sent from the geotools-gt2-users mailing

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread filippov70
Thank you very much for taking part in the solution to my problem! I take the data on the coordinates of the XML-file. In SAX parser, I create the geometry and the objects themselves: parcelBuilder.add ("Polygon"); parcelBuilder.add (mp); / / MultiPolygon parcelBuilder.add (cadastreNumber); Simpl

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread Michael Bedward
Jody, I think Vladislav is just starting out with GeoTools, plus he told us that English is not his language, so your reply might seem a bit mysterious :) Vladislav, can you post your code to the list please or if it is very large post it to Jody or myself privately. Michael On 3 October 2011 1

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread Jody Garnett
Well that is looking more like a bug; since it is happening inside the "commit" and not inside code you control. Is there any chance that the "fid" (or FeatureId) is null (in the feature collection you are writing out?) The code looks like the following: /** * Writes the current fidIndex. Wr

Re: [Geotools-gt2-users] writing shapefile problem

2011-10-02 Thread filippov70
ОК, java.io.IOException: Current fid index is null, next must be called before write() at org.geotools.data.shapefile.indexed.IndexedFidWriter.write(IndexedFidWriter.java:251) at org.geotools.data.shapefile.indexed.IndexedShapefileFeatureWriter.write(IndexedShapefileFeatureWriter.

Re: [Geotools-gt2-users] writing shapefile problem

2011-09-30 Thread Jody Garnett
Not sure; can you provide a stack trace? In general we need: 1) to call "next()" to get a feature which we can fill with the new values. 2) to call "write()" to write those values out to disk I would recommend using a transaction for this kind of work; so when you call "commit" it can write th

Re: [Geotools-gt2-users] writing shapefile problem

2011-09-30 Thread Michael Bedward
Hi Vladislav, I have just checked the csv2shp tutorial application and it is working ok. Please post the complete error trace to the list so we can check it out. Michael On 30 September 2011 17:25, filippov70 wrote: > Hi everyone! > > I have tried to solve my problem as in the example - > http

[Geotools-gt2-users] writing shapefile problem

2011-09-30 Thread filippov70
Hi everyone! I have tried to solve my problem as in the example - http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html . When writing data to a file error occurs: java.io.IOException: Current fid index is