You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "JimShady (via GitHub)" <gi...@apache.org> on 2024/07/15 10:44:24 UTC
[I] Issue with st_polygonize and/or st_dump? [sedona]
JimShady opened a new issue, #1523:
URL: https://github.com/apache/sedona/issues/1523
Two (almost identical) queries below. One in PostGIS returns 78 features, the same one in apache-sedona returns 1 feature. I don't understand why - can anyone help/advise please?
### PostGIS query - returns 78 features
```
WITH a_table AS (
SELECT st_boundary(geom) geom
FROM emea_eu_seu.albania_prefectures_2021
UNION ALL
SELECT st_boundary(geom) geom
FROM emea_eu_seu.albania_municipalities_2021
UNION ALL
SELECT st_boundary(geom) geom
FROM emea_eu_seu.albania_2_digit_postcode_areas_2021
),
b_table AS (
SELECT geom
FROM a_table
GROUP BY geom
),
c_table AS (
SELECT ST_Union(geom) geom
FROM b_table
),
d_table AS (
SELECT ST_Polygonize(geom) AS geom
FROM c_table
),
e_table AS (
SELECT st_dump(geom) geom
FROM d_table
)
SELECT COUNT(*) FROM e_table
```
### Sedona query - returns 1 feature
%sql
```
WITH a_table AS (
SELECT st_boundary(st_geomfromwkb(geom_wkb)) geom
FROM hive_metastore.gfk_bronze.albania_prefectures_2021
UNION ALL
SELECT st_boundary(st_geomfromwkb(geom_wkb)) geom
FROM hive_metastore.gfk_bronze.albania_municipalities_2021
UNION ALL
SELECT st_boundary(st_geomfromwkb(geom_wkb)) geom
FROM hive_metastore.gfk_bronze.albania_2_digit_postcode_areas_2021
),
b_table AS (
SELECT geom
FROM a_table
GROUP BY geom
),
c_table AS (
SELECT ST_Union_Aggr(geom) geom
FROM b_table
),
d_table AS (
SELECT ST_Polygonize(geom) AS geom
FROM c_table
),
e_table AS (
SELECT st_dump(geom) geom
FROM d_table
)
SELECT COUNT(*) FROM e_table
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sedona.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Issue with st_dump? [sedona]
Posted by "JimShady (via GitHub)" <gi...@apache.org>.
JimShady closed issue #1523: Issue with st_dump?
URL: https://github.com/apache/sedona/issues/1523
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Issue with st_dump? [sedona]
Posted by "JimShady (via GitHub)" <gi...@apache.org>.
JimShady commented on issue #1523:
URL: https://github.com/apache/sedona/issues/1523#issuecomment-2228212888
After some more digging it appears that the issue is with st_dump. In apache-sedona it is not creating 78 rows (I think?) it might be returning an array of 78 items in one record? So perhaps I need to explode it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Issue with st_dump? [sedona]
Posted by "JimShady (via GitHub)" <gi...@apache.org>.
JimShady commented on issue #1523:
URL: https://github.com/apache/sedona/issues/1523#issuecomment-2228218548
Figured it out - I need to run the explode() function after st_dump.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org