I am working on getting the polygon data of different areas loaded into PostgreSQL so that I can do searches within those areas based on address points. I have downloaded postcode data from: https://datashare.is.ed.ac.uk/handle/10283/2597
It looks good and have loaded one of them on QGIS: enter image description here
I have connected my PostgreSQL to QGIS through PostGIS connection. I have PostGIS extension present in the database when looking at Extensions within database. When trying to import to database get error:
enter image description here enter image description here
Not really sure what could be wrong, never worked with QGIS before. What is the proper way to get this data including any underlying fields with polygons converted to PostgreSQL data set, so I can do a lookup based on a field such as postcode area CR5 7 and get the polygon area?
My final goal is to have a search mechanism, so you can specify search within e.g. Manchester and it will only show objects within the city. Or e.g. SW20 and get all within that post code district.
-
1Did you consider PostGIS Shapefile Import/Export Manager (NOT in QGIS): gis.stackexchange.com/questions/87019/… - or do you have reasons to do it in QGIS?Babel– Babel2020年04月26日 14:06:32 +00:00Commented Apr 26, 2020 at 14:06
-
1I can see two possible problems: first make sure you are allowed to create a table in your database, and second the SRID does not seem to be recognized. You should probably specify it in both Source (the one used in your dataset) and Target (which is up to you). If that works, you should also tick 'Create a spatial index', it will help you later.dd_a– dd_a2020年04月26日 17:13:09 +00:00Commented Apr 26, 2020 at 17:13
1 Answer 1
With that data QGIS does not recognize the coordinate reference system and that makes saving to PostGIS to fail. Set the SRID of the layer and try again. I made a successful test with EPSG:27700 but I am not sure if that is the right code. The .prj file that is included in the zip defines an unknown datum and that is probably the reason for the failure.
PROJCS["Transverse_Mercator",GEOGCS["GCS_Airy 1830",DATUM["D_unknown",SPHEROID["airy",6377563.396,299.3249753150316]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["Meter",1]]
-
EPSG is correct epsg.io/27700 has PostGIS INSERT into spatial_ref_sys if required at the bottom of the page.2020年04月26日 18:40:31 +00:00Commented Apr 26, 2020 at 18:40
Explore related questions
See similar questions with these tags.