| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016 |
- version:
- provider: 四维数码研发部
- lastupdated: [ 2024-11-22, ]
- name: 拓扑检查
- topoCheck:
- P00:
- note: "点图层有效性"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode, geometry POINT);
- insert into @outtable@
- select null,createuuid(),ogc_fid sid,'P00' rulecode, geometry
- from @intable_s@ where geometrytype(geometry) = 'POINT' and isvalid(geometry) <> 1;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), (select replace(type_name , ' Z', '') from geometry_type_mapping where type_code = (select geometry_type from geometry_columns where f_table_name = '@intable_s@')), (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));
- "
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "P00.png"
- icon: "processingAlgorithm.png"
- description: "说明:点要素不能无效。"
- P01:
- note: "点必须不能相交(单点)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with t as(
- select createuuid(),c.ogc_fid sid, d.ogc_fid did,'P01' rulecode, c.geometry geometry
- from idx_@intable_s@_geometry a, idx_@intable_s@_geometry b, @intable_s@ c, @intable_s@ d
- where a.rowid < b.rowid
- and (a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- and geometrytype(c.geometry) = 'POINT'
- and geometrytype(d.geometry) = 'POINT')
- insert into @outtable@
- select null,createuuid(),sid,did,rulecode,geometry from t;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), (select replace(type_name , ' Z', '') from geometry_type_mapping where type_code = (select geometry_type from geometry_columns where f_table_name = '@intable_s@')), (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "P01.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的点要素不能与同一图层中的点要素重合。被另一个点覆盖的任何点都是错误的。"
- L00:
- note: "线图层有效性"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode, geometry MULTILINESTRING);
- insert into @outtable@
- select null,createuuid(),ogc_fid sid,'L00' rulecode, geometry geometry
- from @intable_s@ where isvalid(geometry) <> 1;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), (select replace(type_name , ' Z', '') from geometry_type_mapping where type_code = (select geometry_type from geometry_columns where f_table_name = '@intable_s@')), (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L00.png"
- icon: "processingAlgorithm.png"
- description: "说明:线要素不能无效"
- L01:
- note: "线不能有悬挂点"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with d as (
- select createuuid(), ogc_fid,
- 'e' || ogc_fid flag,
- startpoint(geometry) geometry
- from @intable_s@ where not isring(geometry)
- union
- select createuuid(), ogc_fid,
- 'e' || ogc_fid flag,
- endpoint(geometry)
- from @intable_s@ where not isring(geometry)
- ),
- u as (
- select d.ogc_fid sid,flag,
- g.ogc_fid did,
- intersection(d.geometry, g.geometry) geometry
- from d,
- idx_@intable_s@_geometry t,
- @intable_s@ as g
- where X(d.geometry) between t.xmin and t.xmax
- and Y(d.geometry) between t.ymin and t.ymax
- and t.rowid = g.rowid
- and intersects(d.geometry, g.geometry) = 1
- and d.ogc_fid <> g.ogc_fid
- union
- select ogc_fid,
- 's' || ogc_fid flag,
- null did,
- startpoint(geometry) geometry
- from @intable_s@
- where numpoints(geometry) > 2
- and intersects(startpoint(geometry), removepoint(geometry, 0)) = 1
- and not isring(geometry)
- union
- select ogc_fid,
- 'e' || ogc_fid flag,
- null did,
- endpoint(geometry) geometry
- from @intable_s@
- where numpoints(geometry) > 2
- and intersects(
- endpoint(geometry),
- removepoint(geometry, numpoints(geometry) -1)
- ) = 1
- and not isring(geometry)
- )
- insert into @outtable@
- select null,createuuid(),ogc_fid sid, flag did, 'L01' rulecode, geometry
- from d
- where flag not in (select flag from u);
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L01.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的线必须在两个端点处与同一图层中的其他线接触。线的任何端点未与其他线接触都是错误的。"
- L02:
- note: "线不能有伪节点"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with t as
- (
- select PIEUUID, sid, did, rulecode, geometry from
- (
- select PIEUUID, id1 sid,id2 did,'L02' rulecode, inter geometry from
- (
- select PIEUUID, id1, group_concat( casttotext( within(inter, gc) + within(inter, gd) ) , '_') id2 , inter
- from
- (
- select createuuid() PIEUUID, c.ogc_fid id1, d.ogc_fid id2,c.geometry gc, d.geometry gd,
- intersection(c.geometry, d.geometry) inter
- from idx_@intable_s@_geometry a, idx_@intable_s@_geometry b, @intable_s@ c, @intable_s@ d
- where a.rowid < b.rowid
- and (a.xmin < b.xmax and a.xmax > b.xmin and a.ymin < b.ymax and a.ymax > b.ymin)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and touches(c.geometry, d.geometry)
- ) t1
- group by inter
- ) t2
- where geometrytype( inter ) = 'POINT' and id2='0'
- union
- select createuuid(),ogc_fid sid, null did ,'L02' rulecode, startpoint(geometry) geometry
- from @intable_s@
- where not isring(geometry) and st_npoints(geometry) > 2
- and touches( startpoint(geometry), removepoint(geometry, 0) ) = 1
- union
- select createuuid(), ogc_fid sid, null did ,'L02' rulecode, endpoint(geometry) geometry
- from @intable_s@
- where not isring(geometry) and st_npoints(geometry) > 2
- and touches( endpoint(geometry), removepoint(geometry, st_npoints(geometry)-1 ) ) = 1
- order by id1))
- insert into @outtable@
- select null,createuuid(),sid,did,rulecode,geometry from t;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线必须在其端点处与同一图层中的多条线接触。线的任何端点仅与一条其他线接触都是错误的。"
- L03:
- note: "线必须为单一部分"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry MULTILINESTRING);
- insert into @outtable@
- select null,createuuid(),ogc_fid sid,'L03' rulecode, casttomulti(geometry) geometry from @intable_s@
- where geometry is not null and casttosingle(geometry) is null;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L03.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的线要素不能具有一个以上的构成部分。任何具有超过一个构成部分的线要素都是错误的。"
- L04:
- note: "线不能重叠(线)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtableP:
- meaning: 输出点错误表的名字
- type: B
- - outtableL:
- meaning: 输出线错误表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出错误表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists tempTableC;
- create view tempTableC as
- WITH cte(idx, sid, did,cnt,geometry,point) AS
- (
- SELECT 1 idx, sid, did ,cnt, geometry, geometryN(geometry, 1) point from
- (
- select c.ogc_fid sid, d.ogc_fid did,numGeometries(intersection(c.geometry, d.geometry)) cnt,
- intersection(c.geometry, d.geometry) geometry
- from idx_@intable_s@_geometry a,idx_@intable_s@_geometry b, @intable_s@ c, @intable_s@ d
- where a.rowid < b.rowid
- and (a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry) = 1 and overlaps(c.geometry, d.geometry) = 1
- ) t
- UNION ALL
- SELECT idx + 1 idx, sid, did, cnt,geometry, geometryN(geometry , idx +1 ) point FROM cte
- WHERE idx < cnt
- )
- SELECT sid, did, case geometrytype(casttomulti( point)) when 'MULTIPOINT' then '0' when 'MULTILINESTRING' then '1' end as rulecode,
- casttomulti( point) geometry
- FROM cte;
-
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTILINESTRING);
- insert into @outtable@
- SELECT null,createuuid(),sid, did, 'L04' rulecode, geometry
- FROM tempTableC where rulecode = '1';
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L04.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的线不能与同一图层中的线重叠。任何重叠的线都是错误的。"
- L05:
- note: "线不能相交(线)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with t as
- (
- select createuuid(),c.ogc_fid sid, d.ogc_fid did,
- numGeometries(ExtractMultiPoint(intersection(c.geometry, d.geometry))) cnt,
- ExtractMultiPoint(intersection(c.geometry, d.geometry)) geometry
- from idx_@intable_s@_geometry a,idx_@intable_s@_geometry b, @intable_s@ c, @intable_s@ d
- where a.rowid < b.rowid
- and (a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry) = 1 and crosses(c.geometry, d.geometry) = 1
- and ExtractMultiPoint(intersection(c.geometry, d.geometry)) is not null
- ),
- cte(PIEUUID,idx, sid, did, cnt,geometry,line) AS
- (
- SELECT createuuid(),1 idx, sid, did,cnt, geometry, geometryN(geometry, 1) line from t
- UNION ALL
- SELECT createuuid(),idx + 1 idx, sid, did, cnt,geometry, geometryN(geometry , idx +1 ) line FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,PIEUUID,sid, did,'L05' rulecode, line geometry FROM cte order by sid, did;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L05.png"
- icon: "processingAlgorithm.png"
- description: "说明:同一图层中的线互相之间不能相交或叠置。任何与要素叠置的线或任何相交点都是错误的。"
- L06:
- note: "线不能自重叠"
- lastupdated: [ 2024-11-22, ]
- roadmap: "临时表创建为view无法建立索引,暂时去除索引判断"
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - tolerance:
- meaning: 容差
- type: f
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@tolerance@=容差','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists temp_line;
- create table temp_line(UUID,id integer, idx integer, cnt integer, geometry LINESTRING);
- insert into temp_line(UUID,id, idx,cnt, geometry)
- WITH t as
- (select createuuid(), ogc_fid id, numGeometries(DissolveSegments(geometry)) cnt, DissolveSegments(geometry) geometry
- from @intable_s@
- where numpoints(geometry) > 2 )
- ,cte(UUID,idx, id,cnt,geometry,line) AS
- (
- SELECT createuuid(),1 idx, id ,cnt, geometry, geometryN(geometry, 1) line from t
- UNION ALL
- SELECT createuuid(),idx + 1 idx, id, cnt,geometry, geometryN(geometry , idx +1 ) line FROM cte
- WHERE idx < cnt
- )
- SELECT UUID,id, idx, cnt,transform(line,3857) geometry FROM cte order by id, idx;
-
- select recovergeometrycolumn('temp_line', 'geometry', 3857, 'LINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));
- select CreateSpatialIndex('temp_line', 'geometry');
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,idx,rulecode,geometry MULTILINESTRING);
- with t1 as(
- select createuuid() UUID,c.id sid, (c.idx || '_' || d.idx) idx, collect(c.geometry, d.geometry) geom,
- abs(degrees(azimuth(startpoint(c.geometry), endpoint(c.geometry)) - azimuth(startpoint(d.geometry), endpoint(d.geometry)))) angle,
- abs( ST_MaxDistance(c.geometry, d.geometry) - st_length(c.geometry) - st_length(d.geometry)) maxdist,
- ExtractMultiLinestring(intersection(c.geometry, d.geometry)) inter
- from idx_temp_line_geometry a, idx_temp_line_geometry b, temp_line c, temp_line d
- where (a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and c.id = d.id and c.idx < d.idx
- and (( abs(c.idx - d.idx) > 1 and abs(c.idx - d.idx) <> c.cnt - 1 and st_distance(c.geometry, d.geometry) < @tolerance@ )
- or (inter is not null) )
- order by c.id, c.idx, d.idx
- ),
- t2 as(
- select UUID, sid, idx, 'L06' rulecode, casttomulti(transform(geom,CastToInteger( (select srid from geometry_columns where f_table_name = '@intable_s@') ))) geometry from t1
- where (angle < 2.0 or abs( angle - 180.0 ) < 2.0 ) and maxdist > @tolerance@)
- insert into @outtable@
- select null,UUID,sid,idx,rulecode,geometry from t2;
- select recovergeometrycolumn('@outtable@', 'geometry',(select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: double
- ARG: tolerance
- name: 容差
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L06.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线要素不能自相交或自叠置。任何存在要素自叠置的线都是错误的。"
- L07:
- note: "线不能自相交"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,idx,rulecode,geometry POINT);
- with t as(
- select createuuid(), ogc_fid as id,
- numGeometries(ST_SelfIntersections(geometry)) cnt,
- ST_SelfIntersections(geometry) geometry
- from @intable_s@
- where ST_SelfIntersections(geometry) is not null),
- cte(UUID,idx, id,cnt,geometry,line) AS
- (
- SELECT createuuid(), 1 idx, id, cnt, geometry, geometryN(geometry, 1) line from t
- UNION ALL
- SELECT createuuid(),idx + 1 idx, id, cnt,geometry, geometryN(geometry , idx +1 ) line FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,UUID,id,idx,'L07' rulecode, line geometry FROM cte order by id, idx;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L07.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线要素不能自相交。任何存在要素自叠置的线或要素自相交的点都是错误的。"
- L08:
- note: "线不能相交或者内部相连"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtableP:
- meaning: 输出点错误表的名字
- type: B
- - outtableL:
- meaning: 输出线错误表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- # RARG: [ '@intable_s@=输入表的名字','@outtableP@=输出点错误表的名字','@outtableL@=输出线错误表的名字' ]
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists L08view;
- create view L08view as
- select c.ogc_fid sid, d.ogc_fid did,
- numGeometries( intersection( c.geometry, d.geometry )) cnt,
- intersection( c.geometry, d.geometry ) geometry
- from idx_@intable_s@_geometry a, idx_@intable_s@_geometry b, @intable_s@ as c, @intable_s@ as d
- where a.rowid < b.rowid
- and (a.xmin < b.xmax and a.xmax > b.xmin and a.ymin < b.ymax and a.ymax > b.ymin)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry )
- and relate(c.geometry, d.geometry) not like 'FF_F0____';
- drop table if exists @outtable@_P;
- create table @outtable@_P(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with t as (select sid,did,cnt, geometry geometry
- from L08view
- where geometrytype(geometry) like '%POINT')
- , cte as (
- SELECT 1 idx, sid, did, cnt, geometry, geometryN(geometry, 1) line from t
- UNION ALL
- SELECT idx + 1 idx, sid, did,cnt,geometry, geometryN(geometry , idx + 1 ) line FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@_P
- select null,createuuid(),sid,did,'L08' rulecode,line geometry from cte
- order by sid, did, idx;
- select recovergeometrycolumn('@outtable@_P', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTILINESTRING);
- insert into @outtable@
- select null,createuuid(), sid,did, 'L08' rulecode, ExtractMultiLinestring(geometry) geometry
- from L08view
- where geometrytype(geometry) like '%LINESTRING'
- order by sid, did;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L08.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线必须在其端点处与同一图层中的其他线相接触。任何与要素叠置的线或任何相交点都是错误的。"
- L09:
- note: "线线相交交点处必须存在节点"
- lastupdated: [ 2024-11-22, ]
- roadmap: "存在问题,临时表创建为view无法建立索引,最后的判断无法进行"
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists temp_points;
- create table temp_points(id integer, idx integer,geometry POINT);
- insert into temp_points(id, idx, geometry)
- WITH t as (
- select ogc_fid id,
- numGeometries(DissolvePoints(geometry)) cnt,
- DissolvePoints(geometry) geometry
- from @intable_s@
- ),
- cte(idx, id, cnt, geometry, point) AS (
- SELECT 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, 1) point
- from t
- UNION ALL
- SELECT idx + 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) point
- FROM cte
- WHERE idx < cnt
- )
- SELECT id,
- idx,
- point geometry
- FROM cte
- order by id,
- idx;
- select recovergeometrycolumn('temp_points', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'),'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));
- select CreateSpatialIndex('temp_points', 'geometry');
-
- drop table if exists temp_points_other;
- create table temp_points_other(id integer, idx integer,geometry POINT);
- insert into temp_points_other(id, idx, geometry)
- WITH t as (
- select c.ogc_fid id,
- numgeometries(ExtractMultiPoint(intersection(c.geometry, d.geometry))) cnt,
- ExtractMultiPoint(intersection(c.geometry, d.geometry)) geometry
- from idx_@intable_s@_geometry a,
- idx_@intable_s@_geometry b,
- @intable_s@ as c,
- @intable_s@ as d
- where a.rowid < b.rowid
- and (
- a.xmin <= b.xmax
- and a.xmax >= b.xmin
- and a.ymin <= b.ymax
- and a.ymax >= b.ymin
- )
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and crosses(c.geometry, d.geometry) = 1
- and ExtractMultiPoint(intersection(c.geometry, d.geometry)) is not null
- ),
- cte(idx, id, cnt, geometry, point) AS (
- SELECT 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, 1) point
- from t
- UNION ALL
- SELECT idx + 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) point
- FROM cte
- WHERE idx < cnt
- )
- SELECT id,
- idx,
- point geometry
- FROM cte
- order by id,
- idx;
- select recovergeometrycolumn('temp_points_other', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'),'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));
- select CreateSpatialIndex('temp_points_other', 'geometry');
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,idx,rulecode,geometry POINT);
- insert into @outtable@
- select null,createuuid(),id,
- idx,
- 'L09' rulecode,
- geometry
- from temp_points_other
- where rowid not in (
- select a.rowid
- from idx_temp_points_other_geometry a,
- idx_temp_points_geometry b
- where (
- a.xmin < b.xmax
- and a.xmax > b.xmin
- and a.ymin < b.ymax
- and a.ymax > b.ymin
- ));
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L09.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的线如果存在相交的情况,那么在相交处必须存在节点。任何不存在节点的相交线都是错误的。"
- L10:
- note: "线节点距离必须大于聚合阈值"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - tolerance:
- meaning: 容差
- type: f
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@tolerance@=容差','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,idx,length,rulecode,geometry LINESTRING);
- WITH t as (
- select createuuid(), ogc_fid id,
- numGeometries(DissolveSegments(geometry)) cnt,
- DissolveSegments(geometry) geometry
- from @intable_s@
- ),
- cte(UUID,idx, id, cnt, geometry, line) AS (
- SELECT createuuid(),
- 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, 1) line
- from t
- UNION ALL
- SELECT createuuid(),
- idx + 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) line
- FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,UUID, id,
- idx,
- st_length(transform(line,3857)) length,
- 'L10' rulecode,
- line geometry
- FROM cte
- where st_length(transform(line,3857)) < @tolerance@
- order by id,idx;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'LINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: double
- ARG: tolerance
- name: 容差
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "L10.png"
- icon: "processingAlgorithm.png"
- description: "说明: 线节点距离必须大于拓扑容差值,这样两个节点自动连接在一起,避免有缝隙出现。任何两个小于拓扑容差距离的线节点都是错误的。"
- A00:
- note: "面有效性检查"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry MULTIPOLYGON);
- insert into @outtable@
- select null,createuuid(),ogc_fid sid,'A00' rulecode, geometry geometry
- from @intable_s@ where isvalid(geometry) <> 1;
- select recovergeometrycolumn('@outtable@','geometry',(select srid from geometry_columns where f_table_name = '@intable_s@') ,'MULTIPOLYGON',(select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "A00.png"
- icon: "processingAlgorithm.png"
- description: "说明: 面要素不能无效"
- A01:
- note: "面不能重叠"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POLYGON);
- with t as(
- select createuuid(),c.ogc_fid sid, d.ogc_fid did,
- numGeometries(intersection(c.geometry, d.geometry)) cnt,
- intersection(c.geometry, d.geometry) geometry
- from idx_@intable_s@_geometry a,
- idx_@intable_s@_geometry b,
- @intable_s@ as c,
- @intable_s@ as d
- where a.rowid < b.rowid
- and (
- a.xmin < b.xmax
- and a.xmax > b.xmin
- and a.ymin < b.ymax
- and a.ymax > b.ymin
- )
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry) = 1
- and ST_Dimension(intersection(c.geometry, d.geometry)) > 1
- ),
- cte(PIEUUID,idx, sid,did, cnt, geometry, subgeom) AS (
- SELECT createuuid(),
- 1 idx,
- sid,
- did,
- cnt,
- geometry,
- geometryN(geometry, 1) subgeom
- from t
- UNION ALL
- SELECT PIEUUID,
- idx + 1 idx,
- sid,
- did,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) subgeom
- FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,PIEUUID,sid,
- 'A01' rulecode,
- subgeom geometry
- FROM cte
- where geometrytype(subgeom) = 'POLYGON'
- order by sid,
- did;
- select recovergeometrycolumn('@outtable@', 'geometry',(select srid from geometry_columns where f_table_name = '@intable_s@'), 'POLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "A01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个区域不能与同一图层的另一个区域叠置。任何存在要素重叠的区域都是错误的。"
- A02:
- note: "面自身不能有内洞"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,ringNum,rulecode,geometry MULTIPOLYGON);
- insert into @outtable@
- select null,createuuid(),ogc_fid sid, NumInteriorRing(geometry) ringNum, 'A02' rulecode, geometry geometry
- from @intable_s@
- where NumInteriorRing(geometry) > 0
- order by sid;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTIPOLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "A02.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个区域内部不能出现空的情况。任何存在空的区域都是错误的。"
- A03:
- note: "面不能有空隙"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,idx,rulecode,geometry MULTILINESTRING);
- with t as(
- select 0 sid,
- 0 did,
- numgeometries(linesfromrings(gunion(geometry))) cnt,
- linesfromrings(gunion(geometry)) geometry
- from @intable_s@
- ),
- cte(idx, sid, did, cnt, geometry, subgeom) AS (
- SELECT 1 idx,
- sid,
- did,
- cnt,
- geometry,
- geometryN(geometry, 1) subgeom
- from t
- UNION ALL
- SELECT idx + 1 idx,
- sid,
- did,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) subgeom
- FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,createuuid(),
- sid,
- idx,
- 'A03' rulecode,
- casttomulti(subgeom) geometry
- FROM cte;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "A03.png"
- icon: "processingAlgorithm.png"
- description: "说明: 同一图层中的区域之间不能存在空隙。存在任何空隙的边界都是错误的。"
- A04:
- note: "面不能自相交"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry MULTIPOLYGON);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'A04' rulecode,
- geometry geometry
- from @intable_s@
- where ST_NumPoints(linesfromrings(geometry)) > 3
- and ST_SelfIntersections(linesfromrings(geometry)) is not null;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTIPOLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));
- "
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "A04.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的面要素不能自相交。任何存在要素自叠置的面或要素自相交的点都是错误的。"
- A05:
- note: "面节点距离必须大于聚合阈值"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - tolerance:
- meaning: 容差
- type: f
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@tolerance@=容差','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,idx,length,rulecode,geometry LINESTRING);
- WITH t as (
- select createuuid(),ogc_fid id,
- numGeometries(DissolveSegments(geometry)) cnt,
- DissolveSegments(geometry) geometry
- from @intable_s@
- ),
- cte(UUID,idx, id, cnt, geometry, line) AS (
- SELECT createuuid(),
- 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, 1) line
- from t
- UNION ALL
- SELECT createuuid(),
- idx + 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) line
- FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,UUID,
- id,
- idx,
- st_length(transform(line,3857)) length,
- 'A05' rulecode,
- line geometry
- FROM cte
- where st_length(transform(line,3857)) < @tolerance@
- order by id,
- idx;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'LINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: double
- ARG: tolerance
- name: 容差
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "A05.png"
- icon: "processingAlgorithm.png"
- description: "说明: 面节点距离必须大于容差值,这样两个节点自动连接在一起,避免多边形有缝隙出现。任何两个小于容差距离的节点都是错误的。"
- PP01:
- note: "点必须被其他要素类覆盖(点-点)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POINT);
- insert into @outtable@
- select null,createuuid(),ogc_fid sid,'PP01' rulecode, geometry from @intable_s@ where rowid not in
- (select a.rowid
- from idx_@intable_s@_geometry a, idx_@intable_t@_geometry b, @intable_s@ c, @intable_t@ d
- where (a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- and geometrytype(c.geometry) = 'POINT'
- and geometrytype(d.geometry) = 'POINT');
- select recovergeometrycolumn('@outtable@', 'geometry',(select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT',(select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PP01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的点要素必须被另一个图层中的点要素重合。第一个图层中未被第二个图层中的点覆盖的任何点都是错误的。"
- PP02:
- note: "点不与其他要素点重合(点-点)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,count,rulecode,geometry POINT);
- with t as
- (
- select createuuid() uuid,c.ogc_fid sid, count(1) count, 'PP02' rulecode, c.geometry geometry
- from idx_@intable_s@_geometry a, idx_@intable_t@_geometry b,
- @intable_s@ c, @intable_t@ d
- where (a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- and geometrytype(c.geometry) = 'POINT'
- and geometrytype(d.geometry) = 'POINT'
- group by c.ogc_fid)
- insert into @outtable@
- select null,uuid,sid,count,rulecode,geometry from t;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PP02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的点要素不与另一个图层中的点要素重合。第一个图层中被第二个图层中的点覆盖的任何点都是错误的。"
- PL01:
- note: "点必须被其他要素类的端点覆盖(点-线)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POINT);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'PL01' rulecode,
- geometry
- from @intable_s@
- where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and touches(c.geometry, d.geometry)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PL01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的点要素必须被另一个图层的线要素的端点覆盖。如果点图层中的要素未落在线要素端点上,则是错误的。"
- PL02:
- note: "点必须被线覆盖(点-线)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POINT);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'PL02' rulecode,
- geometry
- from @intable_s@
- where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- and not touches(c.geometry, d.geometry)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PL02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的点要素必须被另一个图层中的线要素覆盖。任何未被线要素覆盖的点都是错误的。"
- PA01:
- note: "点必须被其他要素的边界覆盖(点-面)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POINT);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'PA01' rulecode,
- geometry
- from @intable_s@
- where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and touches(c.geometry, d.geometry)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PA01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的点要素必须与另一个图层中面要素的边界重合。如果点图层中的要素未落在边界上,则它是错误的。"
- PA02:
- note: "点必须完全位于面内部(点-面)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POINT);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'PA02' rulecode,
- geometry
- from @intable_s@
- where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and within(c.geometry, d.geometry)
- and not touches(c.geometry, d.geometry)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PA02.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的点要素必须完全位于另一个图层的面要素内。未在面要素内的任何点都是错误的。"
- PA03:
- note: "点不在面内部或边界(点-面)"
- lastupdated: [ 2024-11-22, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with t as
- (
- select createuuid() uuid, c.ogc_fid sid, group_concat(d.ogc_fid, '-') did,'PA03' rulecode,c.geometry geometry
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- group by c.ogc_fid)
- insert into @outtable@
- select null,uuid,sid,did,rulecode,geometry from t;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入点图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "PA03.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的点要素不能位于另一个图层的面要素内部或边界。在面要素内部和边界的任何点都是错误的。"
- LP01:
- note: "线端点必须被其他要素覆盖(线-点)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry LINESTRING);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'LP01' rulecode,
- geometry geometry
- from @intable_s@
- where rowid not in(
- select rowid from (
- select a.rowid,count(*) cnt
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and touches(c.geometry, d.geometry)
- group by a.rowid
- having cnt > 1)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LP01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中线的端点必须被另一个图层中的点要素覆盖。任何未被点要素覆盖的端点都是错误的。"
- LL01:
- note: "线不能与其他要素线相交(线-线)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POINT);
- with t as (
- select c.ogc_fid id,
- numGeometries(intersection(c.geometry, d.geometry)) cnt,
- intersection(c.geometry, d.geometry) geometry
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and crosses(c.geometry, d.geometry)
- ),
- cte(idx, id, cnt, geometry, line) AS (
- SELECT 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, 1) line
- from t
- UNION ALL
- SELECT idx + 1 idx,
- id,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) line
- FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,createuuid(),
- id sid,
- idx did,
- 'LL01' rulecode,
- line geometry
- FROM cte
- order by id,
- idx;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POINT', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LL01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线不能与另一个图层中的线相交。第二个图层中的要素与第一个图层中的要素相交的任何线都是错误的。"
- LL02:
- note: "线必须被其他要素类的要素覆盖(线-线)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists LL02view; create view LL02view as
- select c.ogc_fid sid,c.geometry cg, d.ogc_fid did, d.geometry dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- order by c.ogc_fid;
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry MULTILINESTRING);
- with sel as
- (
- select sid from LL02view where overlaps(cg,dg) union
- select ogc_fid from @intable_s@ where ogc_fid not in(
- SELECT sid FROM LL02view where equals(cg, dg) or overlaps(cg, dg)
- )
- ), t as
- (
- select c.ogc_fid sid,c.geometry cg, d.ogc_fid did, d.geometry dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where c.ogc_fid in sel
- and a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- order by sid, did
- ),u as
- (
- select sid, st_difference(cg , gunion(dg) ) geom from t
- group by sid
- )
- insert into @outtable@
- select null,createuuid(),sid,'LL02' rulecode, ExtractMultiLinestring(geom) geometry
- from u
- where ExtractMultiLinestring(geom) is not null;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LL02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线必须与另一个图层中的线重合。第一个图层中有任何线未与第二个图层的线重合都是错误的。"
- LL03:
- note: "线不能与其他要素重叠(线-线)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTILINESTRING);
- with t as
- (
- select c.ogc_fid sid, d.ogc_fid did, 'LL03' rulecode,
- ExtractMultiLinestring(intersection(c.geometry, d.geometry)) geometry
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry) = 1
- and ST_Dimension(intersection(c.geometry,d.geometry)) = 1)
- insert into @outtable@
- select null,createuuid(),sid,did,rulecode,geometry from t;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LL03.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线不能与另一个图层中的线重叠。第二个图层中的要素与第一个图层中的要素重叠处的任何线都是错误的。"
- LL04:
- note: "线不能与其他要素相交或内部相连"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtableP:
- meaning: 输出点错误表的名字
- type: B
- - outtableL:
- meaning: 输出线错误表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出错误表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists LL04view;
- create view LL04view as
- select c.ogc_fid sid, d.ogc_fid did,
- numGeometries( intersection( c.geometry, d.geometry )) cnt,
- intersection( c.geometry, d.geometry ) geometry
- from idx_@intable_s@_geometry a, idx_@intable_t@_geometry b,
- @intable_s@ as c, @intable_t@ as d
- where (a.xmin < b.xmax and a.xmax > b.xmin and a.ymin < b.ymax and a.ymax > b.ymin)
- and a.rowid = c.rowid and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry )
- and relate(c.geometry, d.geometry) not like 'FF_F0____';
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTILINESTRING);
- insert into @outtable@
- select null,createuuid(),sid,did, 'LL04' rulecode, ExtractMultiLinestring(geometry) geometry
- from LL04view
- where geometrytype(geometry) like '%LINESTRING'
- order by sid, did;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LL04.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线只能在其端点处与另一图层中的线相接触。任何与要素叠置的线或任何交叉点都是错误的。"
- LA01:
- note: "线必须完全位于面内部"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry LINESTRING);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'LA01' rulecode,
- geometry geometry
- from @intable_s@
- where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and within(c.geometry, d.geometry) = 1
- and touches(c.geometry, linesfromrings(d.geometry) <> 1)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LA01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线必须包含在另一个图层的面要素内。第一个图层中未包含在第二个图层面要素内的任何线都是错误的。"
- LA02:
- note: "线必须被其他要素的边界覆盖"
- lastupdated: [ 2023-1-4, ]
- roadmap: "结果创建的是table而不是view"
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists LA02view;
- create view LA02view as
- select c.ogc_fid sid,c.geometry cg, d.ogc_fid did, linesfromrings(d.geometry) dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, linesfromrings(d.geometry))
- and relate(c.geometry, linesfromrings(d.geometry)) like '1%'
- order by c.ogc_fid;
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTILINESTRING);
- with t1 as
- (
- select sid, group_concat(did, '-') did, 'LA02' rulecode,
- ExtractMultiLinestring(st_difference(cg, gunion(dg))) geometry
- from LA02view
- group by sid
- having geometry is not null)
- insert into @outtable@
- select null,createuuid(),sid,did,rulecode,geometry from t1;
- with t2 as
- (
- select createuuid(),ogc_fid sid, null did, 'LA02' rulecode , ExtractMultiLinestring(geometry) geometry
- from @intable_s@
- where ogc_fid not in (select sid from LA02view))
- insert into @outtable@
- select null,createuuid(),sid,did,rulecode,geometry from t2;
-
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LA02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线要素必须与另一个图层面要素的边界重合。线图层要素中与面图层边界不重合的任何线都是错误的。"
- LA03:
- note: "线不能与面重叠"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTILINESTRING);
- with t as(
- select c.ogc_fid sid, d.ogc_fid did, 'LA03' rulecode,
- ExtractMultiLinestring(intersection(c.geometry, d.geometry) ) geometry
- from idx_@intable_s@_geometry a, idx_@intable_t@_geometry b, @intable_s@ c, @intable_t@ d
- where a.xmax >= b.xmin and a.xmin <= b.xmax and a.ymax >= b.ymin and a.ymin <= b.ymax
- and a.rowid = c.rowid and b.rowid = d.rowid
- and ( crosses(c.geometry, d.geometry) or within(c.geometry, d.geometry) )
- and ExtractMultiLinestring(intersection(c.geometry, d.geometry) ) is not null)
- insert into @outtable@
- select null,createuuid(),sid,did,rulecode,geometry from t;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入线图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "LA03.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的线不能与另一个图层中的面重叠。第二个图层中的要素与第一个图层中的要素重叠处的任何区域都是错误的。"
- AP01:
- note: "面必须包含点"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POLYGON);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'AP01' rulecode,
- geometry geometry
- from @intable_s@
- where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and contains(c.geometry, d.geometry) = 1
- order by a.rowid
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTIPOLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AP01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的面要素必须至少包含另一个图层中的一个点要素。任何不包含至少一个点要素的面要素都是错误的。"
- AP02:
- note: "面只能包含一个点(面的内部的点个数不是1(0,2...))"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POLYGON);
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,
- 'AP02' rulecode,
- geometry geometry
- from @intable_s@
- where rowid not in(
- select c.rowid sid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where (
- b.xmax >= a.xmin
- and b.xmin <= a.xmax
- and b.ymax >= a.ymin
- and b.ymin <= a.ymax
- )
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and contains(c.geometry, d.geometry) = 1
- group by sid
- having count(d.rowid) = 1
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTIPOLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标点图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AP02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的面要素必须完全包含另一个图层中的一个点要素。任何未完全包含一个点要素的面要素都是错误的。"
- AL01:
- note: "面边界必须被其他要素覆盖(面-线)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry MULTILINESTRING);
- with t1 as(
- select c.ogc_fid sid,linesfromrings(c.geometry) cg, d.ogc_fid did, d.geometry dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(linesfromrings(c.geometry), d.geometry)
- and ST_Dimension(intersection(linesfromrings(c.geometry), d.geometry)) = 1
- order by c.ogc_fid, d.ogc_fid
- ) ,
- t2 as(
- select sid,'AL01' rulecode, casttomulti(st_difference(cg, gunion(dg))) geometry
- from t1 group by sid)
- insert into @outtable@
- select null,createuuid(),
- sid,rulecode,geometry
- from t2 where geometry is not null;
- insert into @outtable@
- select null,createuuid(),
- ogc_fid sid,'AL01' rulecode, casttomulti(linesfromrings(geometry)) geometry
- from @intable_s@ where rowid not in(
- select c.rowid sid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(linesfromrings(c.geometry), d.geometry)
- and ST_Dimension(intersection(linesfromrings(c.geometry), d.geometry)) = 1
- order by c.rowid, d.rowid
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标线图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AL01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中面要素的边界必须被另一个图层的线要素覆盖。未与线要素重合的面要素边界是错误的。"
- AA01:
- note: "面不与其他要素重叠(面-面)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry POLYGON);
- with t as(
- select c.ogc_fid sid, d.ogc_fid did,
- numGeometries(intersection(c.geometry, d.geometry)) cnt,
- intersection(c.geometry, d.geometry) geometry
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ as c,
- @intable_t@ as d
- where (
- a.xmin < b.xmax
- and a.xmax > b.xmin
- and a.ymin < b.ymax
- and a.ymax > b.ymin
- )
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry) = 1
- and ST_Dimension(intersection(c.geometry, d.geometry)) > 1
- ),
- cte(idx, sid, did, cnt, geometry, subgeom) AS (
- SELECT 1 idx,
- sid,
- did,
- cnt,
- geometry,
- geometryN(geometry, 1) subgeom
- from t
- UNION ALL
- SELECT idx + 1 idx,
- sid,
- did,
- cnt,
- geometry,
- geometryN(geometry, idx + 1) subgeom
- FROM cte
- WHERE idx < cnt
- )
- insert into @outtable@
- SELECT null,createuuid(),
- sid,
- did,
- 'AA01' rulecode,
- subgeom geometry
- FROM cte
- where geometrytype(subgeom) = 'POLYGON'
- order by sid,
- did;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AA01.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中的区域不能与另一个图层中的区域重叠。第二个图层中的要素与第一个图层中的要素重叠处的任何区域都是错误的。"
- AA02:
- note: "面必须被其他要素类的要素覆盖"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists AA02view;
- create view AA02view as
- select c.ogc_fid cid, d.ogc_fid did, c.geometry cg, d.geometry dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry);
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTIPOLYGON);
- insert into @outtable@
- select null,createuuid(),cid sid, ids did, 'AA02' rilecode, geom geometry from (
- select cid, group_concat(did, '-') ids, ExtractMultiPolygon(ST_Difference(cg, gunion(dg))) geom
- from AA02view
- group by cid
- ) where geom is not null;
- insert into @outtable@
- select null,createuuid(),ogc_fid sid, null did, 'AA02' rulecode, casttomulti(geometry) geometry from @intable_s@
- where ogc_fid not in (select cid from AA02view);
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTIPOLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AA02.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层的面要素必须覆盖另一个图层的面要素。如果任何区域中第一个图层中的要素没有被第二个图层中的要素覆盖,该区域都是错误的。"
- AA03:
- note: "面必须互相覆盖"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists AA03view;
- create view AA03view as
- select c.ogc_fid cid, d.ogc_fid did, c.geometry cg, d.geometry dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- and not touches(c.geometry, d.geometry);
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,did,rulecode,geometry MULTIPOLYGON);
- insert into @outtable@
- select null,createuuid(), cid sid, ids did, 'AA03' rilecode, geom geometry from (
- select cid, group_concat(did, '-') ids, ExtractMultiPolygon(ST_Difference(cg, gunion(dg))) geom from AA03view
- group by cid
- ) where geom is not null;
-
- insert into @outtable@
- select null,createuuid(),ids sid, did ,'AA03' rilecode, geom geometry from (
- select did, group_concat(cid, '-') ids, ExtractMultiPolygon(ST_Difference(dg, gunion(cg))) geom from AA03view
- group by did
- ) where geom is not null;
-
- insert into @outtable@
- select null,createuuid(), ogc_fid sid, null did, 'AA03' rulecode, casttomulti(geometry) geometry
- from @intable_s@ where ogc_fid not in (select cid from AA03view);
-
- insert into @outtable@
- select null,createuuid(),null sid, ogc_fid did, 'AA03' rulecode, casttomulti(geometry) geometry
- from @intable_t@ where ogc_fid not in (select did from AA03view);
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTIPOLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AA03.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层的面要素必须与另一个图层的面要素互相覆盖。如果在任何区域中一个图层的要素未覆盖另一个图层的要素,该区域都是错误的。"
- AA04:
- note: "面必须被单个面覆盖(村必须在某个乡镇之内)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry POLYGON);
- insert into @outtable@
- select null,createuuid(), ogc_fid sid, 'AA04' rulecode, geometry geometry
- from @intable_s@ where rowid not in(
- select a.rowid
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(c.geometry, d.geometry)
- and within(c.geometry, d.geometry)
- );
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'POLYGON', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AA04.png"
- icon: "processingAlgorithm.png"
- description: "说明:一个图层中的面要素必须包含在另一个图层的面要素内。第一个图层中的任何面要素未包含在第二个图层的要素内都是错误的。"
- AA05:
- note: "面边界必须被其他要素边界覆盖(面-面)"
- lastupdated: [ 2023-1-4, ]
- roadmap: ""
- front: [ ]
- ARG:
- - intable_s:
- meaning: 输入表的名字
- type: B
- - intable_t:
- meaning: 目标表的名字
- type: B
- RTN:
- - outtable:
- meaning: 输出表的名字
- type: B
- DRTN: { meaning: 正确执行返回1, type: int }
- RARG: [ '@intable_s@=输入表的名字','@intable_t@=目标表的名字','@outtable@=输出表的名字' ]
- RUNTYPE: repl
- ALG: "drop view if exists AA05view;
- create view AA05view as
- select c.ogc_fid sid,linesfromrings(c.geometry) cg, d.ogc_fid did, linesfromrings(d.geometry) dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- and intersects(linesfromrings(c.geometry), linesfromrings(d.geometry))
- order by c.ogc_fid;
- drop table if exists @outtable@;
- create table @outtable@(ID INTEGER PRIMARY KEY not null,UUID VARCHAR(128),sid,rulecode,geometry MULTILINESTRING);
- with sel as
- (
- select sid from AA05view where overlaps(cg,dg) union
- select ogc_fid from @intable_s@ where ogc_fid not in(
- SELECT sid FROM AA05view where equals(cg, dg) or overlaps(cg, dg)
- )
- ), t as
- (
- select c.ogc_fid sid,linesfromrings(c.geometry) cg, d.ogc_fid did, linesfromrings(d.geometry) dg
- from idx_@intable_s@_geometry a,
- idx_@intable_t@_geometry b,
- @intable_s@ c,
- @intable_t@ d
- where c.ogc_fid in sel
- and a.xmax >= b.xmin
- and a.xmin <= b.xmax
- and a.ymax >= b.ymin
- and a.ymin <= b.ymax
- and a.rowid = c.rowid
- and b.rowid = d.rowid
- order by sid, did
- ),u as
- (
- select sid, st_difference(cg , gunion(dg) ) geom from t
- group by sid
- )
- insert into @outtable@
- select null,createuuid(),sid,'AA05' rulecode, ExtractMultiLinestring(geom) geometry
- from u
- where ExtractMultiLinestring(geom) is not null;
- select recovergeometrycolumn('@outtable@', 'geometry', (select srid from geometry_columns where f_table_name = '@intable_s@'), 'MULTILINESTRING', (select case when coord_dimension == 2 then 'XY' else 'XYZ' end from geometry_columns where f_table_name = '@intable_s@'));"
- UI:
- inparam:
- - type: vector
- ARG: intable_s
- name: 输入面图层
- description:
- defaultValue:
- help:
- - type: vector
- ARG: intable_t
- name: 目标面图层
- description:
- defaultValue:
- help:
- outparam:
- - type: databasetable
- ARG: outtable
- name: 输出结果表
- description:
- fileFilter: "gsf;;shp;;spa"
- defaultValue: newTable
- help: ""
- parentLayerParameterName: intable_s
- image: "AA05.png"
- icon: "processingAlgorithm.png"
- description: "说明: 一个图层中面要素的边界必须被另一个图层中面要素的边界覆盖。第一个图层中任何未被第二个图层中面要素的边界覆盖的面要素边界都是错误的。"
-
-
|