I applied ST_Union
on my set of about 2000 geometries in order to get 12 distinct areas. As a result, I obtained (probably) WKB format that I'm still not able to use in order to get some interesting results.
Why?
What's the reason behind the vanishing geometries from CARTO? And why are they only obtained as WKB after exporting them to a .csv file? Why CARTO doesn't keep them so that I can visualize them simply on a map?
I have one, big table of data: https://skogenskonung.carto.com/dataset/dd1 The table depicts the results of the election in Berlin. There are, among others, geometries, Berlin's districts, number of people who voted, amount of votes each party has received etc.
What I want to do is to divide the data according to the column awk (awk are electoral districts), so that I have 73 rows (there 73 distinct awks). What is also important is that I want to have 73 geometries that depict these awk. So I executed the following query:
SELECT ST_Union(the_geom), SUM(right_afd) AS afd, SUM(right_cdu) AS cdu, SUM(right_wahler) AS waehler
FROM dd1
GROUP BY awk
What I obtained in the column geometry seems to be empty at first. When you hover at it, it says it is a polygon. When I export the result to the .csv file I see very, very long sequence of numbers and capital letters. When I click on "create map" out of the result of this query, it gives me: "The column 'the_geom_webmercator' doesn't exist."
cartodb_id
,the_geom
andthe_geom_webmercator
as mandatory fields in your questies. Could you share the query you are applying? A link to your dataset would be also very helpful.