So I have two shapefiles: one is a hexbinned shapefile with data of how many dogs, cats, and birds in it and another with county lines.
How would I merge the two shapefiles to show which county each hex bin is in? I've tried the following query
create table newhex AS (select * from hexes, counties where ST_Within(hexes.geom, counties.geom));
but I get the error
Error executing user query: ERROR: column "gid" specified more than once
I'm assuming that there are two difference geom columns and that conflicted the geom columns. So I tried another query with explicit selecting the the geom column of the hex bin and the county name with:
select shp_ohhexsm.geom, ohcounties.name from shp_ohhexsm, ohcounties where ST_Within(shp_ohhexsm.geom, ohcounties.geom)
But I get this weird result
Is there any way I can just merge the name of the counties into my hex files without the weird spaces?