Changes between Initial Version and Version 1 of Ticket #976
- Timestamp:
- Apr 2, 2007, 8:30:30 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #976
- Property Cc added
- Property Owner changed from to
- Property Milestone → 1.4.2
- Property Priority highest → high
-
Ticket #976 – Description
initial v1 1 {{{2 1 Wrong conversion to shapefile. 3 2 3 OGR2OGR utility converts vector data into shapefile in a wrong way. Here is a description of the problem. 4 4 5 OGR2OGR utility converts vector data into shapefile in a wrong way. Here is a 6 description of the problem. 7 8 I have a shapefile, for example with a polygon and two holes (see attached 9 pictures, holes are numbered as hole 1 and hole 2). Ordering is CW for exterior 10 and CCW for interiors, see the shpdump for initial file: 11 5 I have a shapefile, for example with a polygon and two holes (see attached pictures, holes are numbered as hole 1 and hole 2). Ordering is CW for exterior and CCW for interiors, see the shpdump for initial file: 6 {{{ 12 7 Shapefile Type: Polygon # of Shapes: 1 13 8 … … 33 28 ( 3.000, 3.000, 0, 0) 34 29 ( 3.000, 2.000, 0, 0) 30 }}} 35 31 36 37 Now lets convert this file from SHP to SHP (Initially I got that bug after 38 converting from TAB to SHP, but it doesnt matter, bug is present when 39 converting from SHP to SHP). 32 Now lets convert this file from SHP to SHP (Initially I got that bug after converting from TAB to SHP, but it doesnt matter, bug is present when converting from SHP to SHP). 40 33 41 34 After convertation shpdump gives the next result: 42 35 {{{ 43 36 Shapefile Type: Polygon # of Shapes: 1 44 37 … … 64 57 ( 4.000, 2.000, 0, 0) 65 58 ( 3.000, 2.000, 0, 0) 59 }}} 60 As you see the hole 2 becomes a usual polygon because of CW coordinate sequence ordering after conversion, but in initial file it was a hole with CCW ordering!!! 66 61 67 As you see the hole 2 becomes a usual polygon because of CW coordinate sequence 68 ordering after conversion, but in initial file it was a hole with CCW ordering!!! 62 So, my deduction is the bug appears during OGR2OGR conversion when in initial data two holes touch each other in one polygon or multipolygon.... 69 63 70 So, my deduction is the bug appears during OGR2OGR conversion when in initial 71 data two holes touch each other in one polygon or multipolygon.... 64 This wrong behaviour is quite critical for java shapefile library for example. It considers this wrong ring as a polygon in multipolygon, not as a hole in polygon. 72 65 73 This wrong behaviour is quite critical for java shapefile library for example. 74 It considers this wrong ring as a polygon in multipolygon, not as a hole in polygon. 75 76 66 {{{ 77 67 P.S. 78 68