I have 1 table of 20k records. there is a final_zone field where the zone could be either 'Conservation', 'ECZ', 'Protection'. there is another field called sub_zone and the conservation and ecz final_zones each have the possibility of having the sub_zone in it, but not every record has a sub_zone. So if I st_union the geometries and group by all the columns I am left with 5 records.
GOAL:
What I want to be able to do is st_union only the geometries that spatially intersect and form a contiguous layer, and that have the same final_zone BUT I want to be able to preserve the sub_zone records in case one or any of the records has a sub_zone. I also want to preserve their original id's and geometries because at some point I am going to try and unravel these records back to their original form (that will be a separate question after I figure out this one) the reason for this is because I am trying to find areas greater than 75 acres without getting rid of the subzone
Logic so far
Have my called roll_up which is st_union of the layer ls_75_pre_resolve with final_zone (3 rows) then a st_dump to break them apart. I take that layer and throw it through a lateral to the ls_75_pre_resolve layer so every piece that has the same final_zone and intersects it is aggregated in the outside select. st_union the inner geometries to form a new merged geometry and use the array_agg function to 'roll up' the unique id's, original geometries, and sub_zone in their own column.
SQL
with roll_up2 as(select (st_dump(shape)).geom,final_zone,
ROW_NUMBER() OVER (ORDER BY shape) as id
from( select st_union(geom) shape,final_zone from conflict.roll_up_test group by final_zone)t
),
abid as(
select t1.final_zone,
t2.id,
array_agg(t1.id) ids, --aggregates ids
array_agg(t1.sub) sub, --aggregates sub_zones
array_agg(t1.geom) polys, --aggregates original geometries
st_union(t1.geom) merge --unions the geoms that touch
from roll_up2 t2 --this table is a st_unioned keep final_zone, then st_dump geometries
cross join lateral(
select p.id,p.sub,p.geom,p.final_zone
from conflict.roll_up_test p where st_intersects(t2.geom,geom)
and t2.final_zone=p.final_zone
)t1
group by t1.final_zone,t2.id
),
acres as(select *,st_area(merge)/43560 merge_acres from abid),
abid2 as(select unnest(ids) ids,final_zone,
unnest(polys) polys,
unnest(sub) sub_zone,
st_union(merge) merge_diss,
merge_acres
from acres
group by unnest(ids),final_zone,unnest(polys),unnest(sub),merge_acres
)
select st_union(st_geomfromewkb(polys::geometry)) geom,
ids, sub_zone,final_zone,merge_acres,
st_area(st_union(st_geomfromewkb(polys::geometry)))/43560 acres --calculates area of original geometry
from abid2 group by ids,sub_zone,final_zone,merge_acres;
so this strangely works okay but I have no idea when I unnest all the array_aggs the rows match back up perfectly to eachother
so the pic below this works perfect because they all became 1 large feature in the initial abid CTE so I was able to calculate their acres correctly (look at the column merge_acres they are all the same! before there were different merged_acres numbers because each surrounding feature had its own calculation
the pic below that redish middle piece is surrounded by all the same zone but DOES NOT touch those outside outside pieces, so this query is not yielding accurate results for this feature.
*this pic is if you run up to and including the first abid statement
you can see in the attribute table 24943 is present in all the ids array and that is that middle piece. so I am trying to get it so that is just one big piece
{
"type": "FeatureCollection",
"name": "roll_up_test",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3424" } },
"features": [
{ "type": "Feature", "properties": { "final_zone": "Protection", "id": 6516, "ids": "{24920,24943}", "sub": "{NULL,NULL}", "polys": "{0103000020600D0000010000000B000000807E5611D62D1841007C26C6F56B2541805338299D2D1841C07CE867016C254140098EA7802D1841005C259C086C2541000734CE662D184140A8E7FD116C2541C0A17B454A2D184140E450331E6C25418025A84C622C184100E64574816C254140869DCB132A1841005FC5197E6D254180C4C851B62B18418069888D4E6D254100C71ECBDA2D1841C00DC731526C254100835E6DFF2D184100D7BD56416C2541807E5611D62D1841007C26C6F56B2541:0103000020600D00000100000012000000809C10892F25184180A92A49DC6F254180F4D8ED38251841008F8AB6B46F2541C01F1BBA40251841C0360588A26F254140D1381F4F251841C0E1E762916F2541401CDE9D6325184180D9B6DE816F25410044F6807D2518410032DA84746F254140869DCB132A1841005FC5197E6D254180006A6D8728184100977921AB6D2541404A4682BA25184100605F21736E2541C08481D323211841007D7508926D2541001A39AF2221184100F34B1E916D254180CAFE9121211841C01FB4E7906D25410057583F9A1E184140DBD9588A6B254140CC89FF681E18410051404432702541C020563A5E1E184140BB12E93671254180950F6D681E184100FE279E3371254180865070C72118410037CBB10A702541809C10892F25184180A92A49DC6F2541}" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 396149.516931511461735, 701946.887012362480164 ], [ 396135.290253929793835, 701952.702945612370968 ], [ 396128.16362776234746, 701956.304972529411316 ], [ 396121.701370343565941, 701960.99590802937746 ], [ 396114.567854430526495, 701967.100226528942585 ], [ 396056.57486017793417, 702016.727095782756805 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 396013.5798674300313, 702119.276431366801262 ], [ 396150.698359593749046, 701993.097221784293652 ], [ 396159.856805846095085, 701984.66941711306572 ], [ 396149.516931511461735, 701946.887012362480164 ] ] ], [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395598.232272930443287, 702426.356525868177414 ], [ 395600.18174409493804, 702417.265664778649807 ], [ 395603.780490178614855, 702408.693175368010998 ], [ 395608.904167596250772, 702400.934988781809807 ], [ 395615.375939428806305, 702394.259477198123932 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 395809.856849677860737, 702165.565380781888962 ], [ 395630.627221260219812, 702265.565180778503418 ], [ 395336.956548761576414, 702153.016521364450455 ], [ 395336.671116262674332, 702152.559173196554184 ], [ 395336.392573513090611, 702152.452546112239361 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395162.249549094587564, 702489.133303195238113 ], [ 395159.556969176977873, 702619.45522103458643 ], [ 395162.106504760682583, 702617.808898866176605 ], [ 395377.859682179987431, 702469.347253531217575 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ] ] } },
{ "type": "Feature", "properties": { "final_zone": "Protection", "id": 6524, "ids": "{24912,24920,24943,24971,24944}", "sub": "{NULL,NULL,NULL,NULL,NULL}", "polys": "{0103000020600D0000010000000F00000080AB42777C1D1841807A28D75B6A25418024A6FD711D1841C0A87C059D6A254140AB31C69C1D184180412E4BBF6A25410057583F9A1E184140DBD9588A6B254180E12024A21E184140BF5F4FCB6A254140C6415FA21E1841401F88B8C56A2541C0EDA6919F1E18410019A0D8B26A254100C2ECB3951E18418066C192A06A2541C0A21E21851E18418091BB8E8F6A254140D96A706E1E184180F47068806A2541808C7272521E184180A9CCAA736A2541809C8B27321E18418074B8CA696A2541C0845CB80E1E184100B4BE22636A2541802B1869E91D1841C053D9EF5F6A254180AB42777C1D1841807A28D75B6A2541:0103000020600D0000010000000B000000807E5611D62D1841007C26C6F56B2541805338299D2D1841C07CE867016C254140098EA7802D1841005C259C086C2541000734CE662D184140A8E7FD116C2541C0A17B454A2D184140E450331E6C25418025A84C622C184100E64574816C254140869DCB132A1841005FC5197E6D254180C4C851B62B18418069888D4E6D254100C71ECBDA2D1841C00DC731526C254100835E6DFF2D184100D7BD56416C2541807E5611D62D1841007C26C6F56B2541:0103000020600D00000100000012000000809C10892F25184180A92A49DC6F254180F4D8ED38251841008F8AB6B46F2541C01F1BBA40251841C0360588A26F254140D1381F4F251841C0E1E762916F2541401CDE9D6325184180D9B6DE816F25410044F6807D2518410032DA84746F254140869DCB132A1841005FC5197E6D254180006A6D8728184100977921AB6D2541404A4682BA25184100605F21736E2541C08481D323211841007D7508926D2541001A39AF2221184100F34B1E916D254180CAFE9121211841C01FB4E7906D25410057583F9A1E184140DBD9588A6B254140CC89FF681E18410051404432702541C020563A5E1E184140BB12E93671254180950F6D681E184100FE279E3371254180865070C72118410037CBB10A702541809C10892F25184180A92A49DC6F2541:0103000020600D00000100000010000000C020563A5E1E184140BB12E93671254180A39EFFC91D184100E644C56671254100ED72B3861A1841C056B17774722541003851CB681A184140E1A8B6ED73254180D4E9C3811A1841C0B00CBD2875254180AF5FF4701C184100152CFF5774254100EBF128C51D184100414497C87325414057DC21FE1D1841C0563F93B07325414010DA20001E1841401490BBAF732541008CD5751D1E184140DC1F6DA0732541408443AE331E18418001065F8E732541401A24CA411E184180AA8D617A73254180DA3227471E1841804E2C5A65732541409C4159471E184140ED019A607325414088AC0F561E1841C05EBE8BFC712541C020563A5E1E184140BB12E936712541:0103000020600D00000100000014000000809C10892F25184180A92A49DC6F254140D64F260B251841C0B0A59075702541007C7ABB08251841C017D8BF7F702541C04FB02B0825184100F7F8A69470254100D14D5010251841804B2328A9702541409EF1CD20251841C09E0C5EBC70254100DC86992F25184100257ED7C670254140EF80EC3825184180AF8671CD70254180AD899D57251841809B93A3DB70254140AA088A7B25184100FDA055E670254180C413DFB1271841808890006971254100FCC09447281841402C4C8B8B712541C0B923F14C281841C0A3066774712541C0C5304E5F28184140FB0A2425712541003F476D00271841C0784FCF67702541C0F2A119F126184180FF71B56070254180FC25CF3026184140504F9E0770254100D4259ED0251841407FB1B6D36F254140454D80662518414058515CD96F2541809C10892F25184180A92A49DC6F2541}" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 396149.516931511461735, 701946.887012362480164 ], [ 396135.290253929793835, 701952.702945612370968 ], [ 396128.16362776234746, 701956.304972529411316 ], [ 396121.701370343565941, 701960.99590802937746 ], [ 396114.567854430526495, 701967.100226528942585 ], [ 396056.57486017793417, 702016.727095782756805 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 396013.5798674300313, 702119.276431366801262 ], [ 396150.698359593749046, 701993.097221784293652 ], [ 396159.856805846095085, 701984.66941711306572 ], [ 396149.516931511461735, 701946.887012362480164 ] ] ], [ [ [ 395103.116465263068676, 701741.920230701565742 ], [ 395100.497704096138477, 701774.510716699063778 ], [ 395111.19354884698987, 701791.646837279200554 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395176.535281680524349, 701797.655027367174625 ], [ 395176.593024346977472, 701794.860413528978825 ], [ 395175.892238344997168, 701785.42309644818306 ], [ 395173.425707846879959, 701776.286631777882576 ], [ 395169.282343428581953, 701767.778774783015251 ], [ 395163.609782595187426, 701760.203986778855324 ], [ 395156.611765094101429, 701753.83359269797802 ], [ 395148.538618512451649, 701748.895938530564308 ], [ 395139.680040430277586, 701745.567861199378967 ], [ 395130.352631263434887, 701743.968454949557781 ], [ 395103.116465263068676, 701741.920230701565742 ] ] ], [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395598.232272930443287, 702426.356525868177414 ], [ 395600.18174409493804, 702417.265664778649807 ], [ 395603.780490178614855, 702408.693175368010998 ], [ 395608.904167596250772, 702400.934988781809807 ], [ 395615.375939428806305, 702394.259477198123932 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 395809.856849677860737, 702165.565380781888962 ], [ 395630.627221260219812, 702265.565180778503418 ], [ 395336.956548761576414, 702153.016521364450455 ], [ 395336.671116262674332, 702152.559173196554184 ], [ 395336.392573513090611, 702152.452546112239361 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395162.249549094587564, 702489.133303195238113 ], [ 395159.556969176977873, 702619.45522103458643 ], [ 395162.106504760682583, 702617.808898866176605 ], [ 395377.859682179987431, 702469.347253531217575 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ], [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395586.78741392865777, 702522.782514117658138 ], [ 395586.183084428310394, 702527.874695532023907 ], [ 395586.042664762586355, 702538.32611820101738 ], [ 395588.078421846032143, 702548.578394278883934 ], [ 395592.201117012649775, 702558.183690033853054 ], [ 395595.899928510189056, 702563.420884281396866 ], [ 395598.230960596352816, 702566.721730694174767 ], [ 395605.903845511376858, 702573.819485530257225 ], [ 395614.884798679500818, 702579.167243868112564 ], [ 395756.467848844826221, 702644.501102700829506 ], [ 395793.895267426967621, 702661.772065527737141 ], [ 395795.235487844794989, 702650.201222531497478 ], [ 395799.826357927173376, 702610.570396281778812 ], [ 395712.106717094779015, 702515.904903195798397 ], [ 395708.275031846016645, 702512.354385361075401 ], [ 395660.20229334384203, 702467.80919886380434 ], [ 395636.154441177845001, 702441.856822945177555 ], [ 395609.625294763594866, 702444.680308111011982 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ], [ [ [ 395159.556969176977873, 702619.45522103458643 ], [ 395122.499628596007824, 702643.385291278362274 ], [ 394913.675243094563484, 702778.233774863183498 ], [ 394906.198552012443542, 702966.856757201254368 ], [ 394912.441321678459644, 703124.369237445294857 ], [ 395036.238646261394024, 703019.998383194208145 ], [ 395121.289985343813896, 702948.29544261097908 ], [ 395135.533067096024752, 702936.287592612206936 ], [ 395136.032081846147776, 702935.866333611309528 ], [ 395143.365072429180145, 702928.213133700191975 ], [ 395148.920179430395365, 702919.185592696070671 ], [ 395152.447403345257044, 702909.190533950924873 ], [ 395153.788279928267002, 702898.676119282841682 ], [ 395153.837164346128702, 702896.300795949995518 ], [ 395157.5153065957129, 702718.272936783730984 ], [ 395159.556969176977873, 702619.45522103458643 ] ] ] ] } },
{ "type": "Feature", "properties": { "final_zone": "Protection", "id": 6528, "ids": "{24943,24958,24944}", "sub": "{NULL,NULL,NULL}", "polys": "{0103000020600D00000100000012000000809C10892F25184180A92A49DC6F254180F4D8ED38251841008F8AB6B46F2541C01F1BBA40251841C0360588A26F254140D1381F4F251841C0E1E762916F2541401CDE9D6325184180D9B6DE816F25410044F6807D2518410032DA84746F254140869DCB132A1841005FC5197E6D254180006A6D8728184100977921AB6D2541404A4682BA25184100605F21736E2541C08481D323211841007D7508926D2541001A39AF2221184100F34B1E916D254180CAFE9121211841C01FB4E7906D25410057583F9A1E184140DBD9588A6B254140CC89FF681E18410051404432702541C020563A5E1E184140BB12E93671254180950F6D681E184100FE279E3371254180865070C72118410037CBB10A702541809C10892F25184180A92A49DC6F2541:0103000020600D0000010000000800000000FCC09447281841402C4C8B8B7125410039C63BE7271841C0277F6A2B73254140AF6ACEC52B18418064CFF60F7425410016F5E8C52B18418053136E0F74254180A770A7D02B184180D47935FD7325410023A618E22B1841C0893B55EC7325418005A7326B2D1841C0949217BB72254100FCC09447281841402C4C8B8B712541:0103000020600D00000100000014000000809C10892F25184180A92A49DC6F254140D64F260B251841C0B0A59075702541007C7ABB08251841C017D8BF7F702541C04FB02B0825184100F7F8A69470254100D14D5010251841804B2328A9702541409EF1CD20251841C09E0C5EBC70254100DC86992F25184100257ED7C670254140EF80EC3825184180AF8671CD70254180AD899D57251841809B93A3DB70254140AA088A7B25184100FDA055E670254180C413DFB1271841808890006971254100FCC09447281841402C4C8B8B712541C0B923F14C281841C0A3066774712541C0C5304E5F28184140FB0A2425712541003F476D00271841C0784FCF67702541C0F2A119F126184180FF71B56070254180FC25CF3026184140504F9E0770254100D4259ED0251841407FB1B6D36F254140454D80662518414058515CD96F2541809C10892F25184180A92A49DC6F2541}" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 395793.895267426967621, 702661.772065527737141 ], [ 395769.808373346924782, 702869.708001367747784 ], [ 396017.451578844338655, 702983.982051029801369 ], [ 396017.477497428655624, 702983.714991196990013 ], [ 396020.16351567953825, 702974.604445114731789 ], [ 396024.524071261286736, 702966.166469864547253 ], [ 396122.799465261399746, 702813.546040199697018 ], [ 395793.895267426967621, 702661.772065527737141 ] ] ], [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395598.232272930443287, 702426.356525868177414 ], [ 395600.18174409493804, 702417.265664778649807 ], [ 395603.780490178614855, 702408.693175368010998 ], [ 395608.904167596250772, 702400.934988781809807 ], [ 395615.375939428806305, 702394.259477198123932 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 395809.856849677860737, 702165.565380781888962 ], [ 395630.627221260219812, 702265.565180778503418 ], [ 395336.956548761576414, 702153.016521364450455 ], [ 395336.671116262674332, 702152.559173196554184 ], [ 395336.392573513090611, 702152.452546112239361 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395162.249549094587564, 702489.133303195238113 ], [ 395159.556969176977873, 702619.45522103458643 ], [ 395162.106504760682583, 702617.808898866176605 ], [ 395377.859682179987431, 702469.347253531217575 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ], [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395586.78741392865777, 702522.782514117658138 ], [ 395586.183084428310394, 702527.874695532023907 ], [ 395586.042664762586355, 702538.32611820101738 ], [ 395588.078421846032143, 702548.578394278883934 ], [ 395592.201117012649775, 702558.183690033853054 ], [ 395595.899928510189056, 702563.420884281396866 ], [ 395598.230960596352816, 702566.721730694174767 ], [ 395605.903845511376858, 702573.819485530257225 ], [ 395614.884798679500818, 702579.167243868112564 ], [ 395756.467848844826221, 702644.501102700829506 ], [ 395793.895267426967621, 702661.772065527737141 ], [ 395795.235487844794989, 702650.201222531497478 ], [ 395799.826357927173376, 702610.570396281778812 ], [ 395712.106717094779015, 702515.904903195798397 ], [ 395708.275031846016645, 702512.354385361075401 ], [ 395660.20229334384203, 702467.80919886380434 ], [ 395636.154441177845001, 702441.856822945177555 ], [ 395609.625294763594866, 702444.680308111011982 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ] ] } },
{ "type": "Feature", "properties": { "final_zone": "Protection", "id": 6610, "ids": "{24943,24971}", "sub": "{NULL,NULL}", "polys": "{0103000020600D00000100000012000000809C10892F25184180A92A49DC6F254180F4D8ED38251841008F8AB6B46F2541C01F1BBA40251841C0360588A26F254140D1381F4F251841C0E1E762916F2541401CDE9D6325184180D9B6DE816F25410044F6807D2518410032DA84746F254140869DCB132A1841005FC5197E6D254180006A6D8728184100977921AB6D2541404A4682BA25184100605F21736E2541C08481D323211841007D7508926D2541001A39AF2221184100F34B1E916D254180CAFE9121211841C01FB4E7906D25410057583F9A1E184140DBD9588A6B254140CC89FF681E18410051404432702541C020563A5E1E184140BB12E93671254180950F6D681E184100FE279E3371254180865070C72118410037CBB10A702541809C10892F25184180A92A49DC6F2541:0103000020600D00000100000010000000C020563A5E1E184140BB12E93671254180A39EFFC91D184100E644C56671254100ED72B3861A1841C056B17774722541003851CB681A184140E1A8B6ED73254180D4E9C3811A1841C0B00CBD2875254180AF5FF4701C184100152CFF5774254100EBF128C51D184100414497C87325414057DC21FE1D1841C0563F93B07325414010DA20001E1841401490BBAF732541008CD5751D1E184140DC1F6DA0732541408443AE331E18418001065F8E732541401A24CA411E184180AA8D617A73254180DA3227471E1841804E2C5A65732541409C4159471E184140ED019A607325414088AC0F561E1841C05EBE8BFC712541C020563A5E1E184140BB12E936712541}" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395598.232272930443287, 702426.356525868177414 ], [ 395600.18174409493804, 702417.265664778649807 ], [ 395603.780490178614855, 702408.693175368010998 ], [ 395608.904167596250772, 702400.934988781809807 ], [ 395615.375939428806305, 702394.259477198123932 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 395809.856849677860737, 702165.565380781888962 ], [ 395630.627221260219812, 702265.565180778503418 ], [ 395336.956548761576414, 702153.016521364450455 ], [ 395336.671116262674332, 702152.559173196554184 ], [ 395336.392573513090611, 702152.452546112239361 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395162.249549094587564, 702489.133303195238113 ], [ 395159.556969176977873, 702619.45522103458643 ], [ 395162.106504760682583, 702617.808898866176605 ], [ 395377.859682179987431, 702469.347253531217575 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ], [ [ [ 395159.556969176977873, 702619.45522103458643 ], [ 395122.499628596007824, 702643.385291278362274 ], [ 394913.675243094563484, 702778.233774863183498 ], [ 394906.198552012443542, 702966.856757201254368 ], [ 394912.441321678459644, 703124.369237445294857 ], [ 395036.238646261394024, 703019.998383194208145 ], [ 395121.289985343813896, 702948.29544261097908 ], [ 395135.533067096024752, 702936.287592612206936 ], [ 395136.032081846147776, 702935.866333611309528 ], [ 395143.365072429180145, 702928.213133700191975 ], [ 395148.920179430395365, 702919.185592696070671 ], [ 395152.447403345257044, 702909.190533950924873 ], [ 395153.788279928267002, 702898.676119282841682 ], [ 395153.837164346128702, 702896.300795949995518 ], [ 395157.5153065957129, 702718.272936783730984 ], [ 395159.556969176977873, 702619.45522103458643 ] ] ] ] } },
{ "type": "Feature", "properties": { "final_zone": "Protection", "id": 6781, "ids": "{24912,24906,24943}", "sub": "{NULL,NULL,NULL}", "polys": "{0103000020600D0000010000000F00000080AB42777C1D1841807A28D75B6A25418024A6FD711D1841C0A87C059D6A254140AB31C69C1D184180412E4BBF6A25410057583F9A1E184140DBD9588A6B254180E12024A21E184140BF5F4FCB6A254140C6415FA21E1841401F88B8C56A2541C0EDA6919F1E18410019A0D8B26A254100C2ECB3951E18418066C192A06A2541C0A21E21851E18418091BB8E8F6A254140D96A706E1E184180F47068806A2541808C7272521E184180A9CCAA736A2541809C8B27321E18418074B8CA696A2541C0845CB80E1E184100B4BE22636A2541802B1869E91D1841C053D9EF5F6A254180AB42777C1D1841807A28D75B6A2541:0103000020600D0000010000000800000080AB42777C1D1841807A28D75B6A2541C0271E3DA71D184140B275AC5169254140685F6D071C184140B0798D9E68254100C38500071C18414060A1369E68254100AEDC2B051C18410053B86C9D68254180D1C5B9FA1A1841C06E9CBBC867254140FFAB2D071B184100F1592E446A254180AB42777C1D1841807A28D75B6A2541:0103000020600D00000100000012000000809C10892F25184180A92A49DC6F254180F4D8ED38251841008F8AB6B46F2541C01F1BBA40251841C0360588A26F254140D1381F4F251841C0E1E762916F2541401CDE9D6325184180D9B6DE816F25410044F6807D2518410032DA84746F254140869DCB132A1841005FC5197E6D254180006A6D8728184100977921AB6D2541404A4682BA25184100605F21736E2541C08481D323211841007D7508926D2541001A39AF2221184100F34B1E916D254180CAFE9121211841C01FB4E7906D25410057583F9A1E184140DBD9588A6B254140CC89FF681E18410051404432702541C020563A5E1E184140BB12E93671254180950F6D681E184100FE279E3371254180865070C72118410037CBB10A702541809C10892F25184180A92A49DC6F2541}" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 395595.883852429687977, 702446.142903611063957 ], [ 395598.232272930443287, 702426.356525868177414 ], [ 395600.18174409493804, 702417.265664778649807 ], [ 395603.780490178614855, 702408.693175368010998 ], [ 395608.904167596250772, 702400.934988781809807 ], [ 395615.375939428806305, 702394.259477198123932 ], [ 395908.948843095451593, 702143.050333946943283 ], [ 395809.856849677860737, 702165.565380781888962 ], [ 395630.627221260219812, 702265.565180778503418 ], [ 395336.956548761576414, 702153.016521364450455 ], [ 395336.671116262674332, 702152.559173196554184 ], [ 395336.392573513090611, 702152.452546112239361 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395162.249549094587564, 702489.133303195238113 ], [ 395159.556969176977873, 702619.45522103458643 ], [ 395162.106504760682583, 702617.808898866176605 ], [ 395377.859682179987431, 702469.347253531217575 ], [ 395595.883852429687977, 702446.142903611063957 ] ] ], [ [ [ 395103.116465263068676, 701741.920230701565742 ], [ 395113.809685345739126, 701608.836835451424122 ], [ 395009.856809262186289, 701519.276319034397602 ], [ 395009.750510260462761, 701519.106699950993061 ], [ 395009.292834013700485, 701518.712343782186508 ], [ 394942.681418679654598, 701412.366427861154079 ], [ 394945.794601429253817, 701730.090529948472977 ], [ 395103.116465263068676, 701741.920230701565742 ] ] ], [ [ [ 395103.116465263068676, 701741.920230701565742 ], [ 395100.497704096138477, 701774.510716699063778 ], [ 395111.19354884698987, 701791.646837279200554 ], [ 395174.561860427260399, 701893.173537112772465 ], [ 395176.535281680524349, 701797.655027367174625 ], [ 395176.593024346977472, 701794.860413528978825 ], [ 395175.892238344997168, 701785.42309644818306 ], [ 395173.425707846879959, 701776.286631777882576 ], [ 395169.282343428581953, 701767.778774783015251 ], [ 395163.609782595187426, 701760.203986778855324 ], [ 395156.611765094101429, 701753.83359269797802 ], [ 395148.538618512451649, 701748.895938530564308 ], [ 395139.680040430277586, 701745.567861199378967 ], [ 395130.352631263434887, 701743.968454949557781 ], [ 395103.116465263068676, 701741.920230701565742 ] ] ] ] } }
]
}
would a recursive query be of use here?!!