linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Self intersecting polygons #253

Closed billgeo closed 3 years ago

billgeo commented 3 years ago

Bug Description

(psycopg2.errors.InternalError_) lwgeom_unaryunion_prec: GEOS Error: TopologyException: Input geom 0 is invalid: Self-intersection at or near point 167.01084300060737 -45.407573102685177 at 167.01084300060737 -45.407573102685177
CONTEXT: SQL statement "insert into tmp_all_shapes1 (feat_id, geom_type, geom )
select
g.feat_id,
g.geom_type,
st_union(ST_Force2D(g.shape))
from
feature_geometry g
join feature f on g.feat_id = f.feat_id
group by g.feat_id, g.geom_type"
PL/pgSQL function gweb_update_gaz_all_shapes() line 17 at SQL statement
SQL statement "SELECT gweb_update_gaz_all_shapes()"
PL/pgSQL function gweb_update_web_database() line 11 at PERFORM

[SQL: select gazetteer.gweb_update_web_database()]
(Background on this error at: http://sqlalche.me/e/2j85)

Steps to Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Desktop

Screenshots

billgeo commented 3 years ago

image003 image001 image002

billgeo commented 3 years ago

Offending polygon:

{"type":"MultiPolygon","coordinates":[[[[167.01078817700508,-45.407619269929214],[167.0108510157539,-45.407572140867593],[167.0104582735737,-45.407619269929221],[167.01033259607601,-45.407823495862935],[167.01011266045509,-45.408012012109445],[167.00987701514697,-45.408059141171066],[167.00945285359234,-45.408012012109445],[167.00909153078652,-45.40802772179665],[167.00890301454001,-45.408137689607109],[167.00862024017027,-45.408231947730364],[167.00818036892841,-45.408310496166408],[167.00778762674818,-45.408341915540824],[167.0074263039424,-45.408420463976867],[167.00712781988543,-45.408404754289656],[167.00678220676684,-45.408326205853612],[167.00649943239708,-45.408216238043153],[167.0061695289657,-45.408200528355941],[167.00580820615988,-45.408294786479203],[167.00561968991337,-45.408310496166408],[167.00521123804594,-45.408404754289656],[167.00470852805526,-45.408420463976867],[167.00422152775181,-45.40837333491524],[167.00378165650994,-45.408294786479203],[167.00324752714485,-45.408200528355941],[167.00271339777976,-45.408137689607109],[167.00238349434835,-45.408012012109445],[167.00221068778907,-45.407760657114096],[167.00202217154256,-45.407509302118754],[167.00180223592164,-45.407352205246667],[167.00134665499257,-45.407147979312953],[167.00082823531469,-45.407022301815282],[167.00063971906818,-45.406818075881567],[167.00041978344726,-45.406566720886225],[167.00001133157983,-45.40661384994786],[166.99958717002519,-45.406472462762977],[166.99910016972171,-45.406283946516467],[166.99892736316241,-45.405922623710666],[166.99894307284964,-45.405608429966492],[166.99927297628102,-45.405372784658354],[166.9997756862717,-45.405247107160683],[167.00012129939029,-45.405152849037435],[167.0004826221961,-45.405074300601392],[167.00076539656584,-45.405011461852553],[167.0011738484333,-45.404917203729305],[167.00144091311583,-45.404932913416516],[167.00180223592164,-45.404917203729305],[167.00210071997864,-45.40505859091418],[167.00241491372279,-45.404964332790925],[167.00277623652858,-45.404964332790925],[167.00320039808324,-45.405042881226969],[167.00426865681342,-45.405262816847895],[167.00588675459593,-45.40540420403277],[167.00670365833079,-45.405341365283938],[167.00748914269124,-45.405105719975808],[167.00863594985748,-45.405152849037435],[167.00940572453069,-45.40540420403277],[167.0103011767016,-45.405812655900199],[167.01113379012367,-45.406189688393212],[167.01135372574461,-45.406802366194356],[167.01108666106205,-45.407367914933872],[167.01078817700508,-45.407619269929214]]]]}
billgeo commented 3 years ago

@CMKMS-LINZ has indicated they will fix these at source and are happy to leave the functionality as is