-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR: Geometry type Poly not match MultiPoly #14870
Comments
Author Name: Andreas Neumann (@andreasneumann) Hi, what are the constraints in the table in Postgis. The error message sounds like a Postgis problem - not like a QGIS problem. There are two potential issues in Postgis:
Theoretically it could also be a QGIS problem - but I would first make sure that everything on the Postgis side is ok? |
Author Name: Salvatore Larosa (@slarosa) Hi, my table is:
I did try to add some constraints:
but I got the same error! more info:
Thanks! |
Author Name: Jürgen Fischer (@jef-n) Salvatore Larosa wrote:
The constraint is the problem (or QGIS' ignorance about it, if you like). Changing it to
could help. |
Author Name: Salvatore Larosa (@slarosa) Jürgen Fischer wrote:
Thanks for the advice, but does not solve the problem! |
Author Name: Salvatore Larosa (@slarosa) I noticed that it happens only if the geometry is identified as a 'MULTI[LINESTRING,POINT,POLYGON]' |
Author Name: Jürgen Fischer (@jef-n) Salvatore Larosa wrote:
That's what I meant. You're trying to save a @polygon@ into a table that you restricted to @multipolygon@ s. But I admit that the postgres provider could internally convert the @polygon@ to a @multipolygon@ if necessary, but it currently just determines if the layer is a point, line or polygon layer as higher levels don't differentiate between single and multi geometries. |
Author Name: Salvatore Larosa (@slarosa) Something terrible has happened! :-) I tried to edit and save with QGIS 1.7.3 (on the PC of a friend, but after that I hate :-)) on windows, and it works perfect! In Linux with the master version, why not? |
Author Name: Salvatore Larosa (@slarosa) I also tried the version 1.7.4 is working correctly on Windows! |
Author Name: Salvatore Larosa (@slarosa) Jürgen Fischer wrote:
Yes, solved! One more thing, Might it solve the problem very like with the SPIT plugin? |
Author Name: Jürgen Fischer (@jef-n) Salvatore Larosa wrote:
Give it a spin. I'd expect that one is solved too.
|
Author Name: Maximilian L. (Maximilian L.) Salvatore Larosa wrote:
I tested 1.7.4 and 1.8 on Windows 7 but got the same error-message in SPIT. :( How can I fix this easily on windows? |
Author Name: Salvatore Larosa (@slarosa) Maximilian L. wrote:
Actually there is not any solution for that, the better way to import SHP into PostGIS is with DB Manager plugin! Also have a look at this #15029, the SPIT plugin will be removed! |
Author Name: Maximilian L. (Maximilian L.) Salvatore Larosa wrote:
Thank you for this information. But trying to import SHP into PostGIS with DB Manager brings me the same error (see picture).
|
Author Name: Salvatore Larosa (@slarosa) Maximilian L. wrote:
I am aware of that! |
Author Name: Maximilian L. (Maximilian L.)
Thank you!
I know but this is no solution for me...seems that I have to use the PostGIS Shapefile Loader. |
Author Name: Giovanni Manghi (@gioman) Maximilian L. wrote:
so also the "PostGIS Manager" plugin works for you? |
Author Name: Salvatore Larosa (@slarosa) Giovanni Manghi wrote:
I think Maximilian was referring to shp2pgsql-gui importer! |
Author Name: Giovanni Manghi (@gioman)
postgis manager uses shp2pgsql so it should work |
Author Name: Salvatore Larosa (@slarosa) Giovanni Manghi wrote:
You're right, works fine! Also, I guess there is a redundance between PostGIS Manager, Spatialite Manager and |
Author Name: Giovanni Manghi (@gioman)
PostGIS manager is abandoned and it will be removed when all its feature will be ported in DB manager. Same for SL manager. I'm not sure but also the RT_SQL plugins will be integrated into DB manager. Anyway, DB manager does not uses shp2pgsql (to avoid have the user install postgis) but it sometimes fails, like in this case. So please file a ticket against DB manager, give it to Giuseppe and if possible attach a sample of the data. |
Author Name: Maximilian L. (Maximilian L.) Salvatore Larosa wrote:
For me it does not: "somethings wrong: The command "shp2pgsql" is wrong written or couldn't be found". In addition I had to edit 2 .py-files of the extension in combination with PostGIS 2.0 to not have an error log at startup. |
Author Name: Giovanni Manghi (@gioman) Maximilian L. wrote:
maybe you don't have shp2pgsql in your path. Under Windows must be added manually. |
Author Name: Maximilian L. (Maximilian L.) Giovanni Manghi wrote:
Where I have to add it? Okay, than it is perhaps my mistake. |
Author Name: Giovanni Manghi (@gioman)
you have to add the path (that points to the folder were shp2pgsql resides) into the "path" Windows environment variable. You find this option in the advanced system settings in your Windows control panel. |
Author Name: Maximilian L. (Maximilian L.) Giovanni Manghi wrote:
Well, this is what I did, but it didn't help (after restart). |
Author Name: Giovanni Manghi (@gioman)
odd, because it certainly works. Try open the Windows terminal and enter the command shp2psql what happens? |
Author Name: Maximilian L. (Maximilian L.) Giovanni Manghi wrote:
Same error message: "Command not found or wrong written". Variable is shp2pgsql and the value is the path where the shp2pgsql.exe is. |
Author Name: Giovanni Manghi (@gioman)
I'm sorry, it means that you have done something wrong. Until the command is not available trough the command line interface it cannot work in QGIS. But anyway, this is why DB Manager does not use shp2pgsql. If you have any error using DB manager then please file a ticket, give it to giuseppe sucameli, and add sample data (along with the error message). |
Author Name: Maximilian L. (Maximilian L.)
This is what I've done --> shp2pgsql.jpg
|
Author Name: Carlos Alberto Machicado Cabezas (Carlos Alberto Machicado Cabezas) Found a solution focused on the shapelfile data, the problem lies in the geometry in this case multipolygon Multipart a way to simplify the geometry of Multipart To Singlepart(multipolygon to polygon) found in the Data Management's toolbox of ArcGis. Regards
|
Author Name: Giovanni Manghi (@gioman) Carlos Alberto Machicado Cabezas wrote:
why reopening this ticket? the multipart to singlepart tool there is also in qgis, what is your point? cheers!
|
Author Name: Salvatore Larosa (@slarosa)
Original Redmine Issue: 5109
Affected QGIS version: master
Redmine category:data_provider/postgis
Assignee: Salvatore Larosa
Hi,
when I try to add a new geometries and then stop editing (save) I get this error:
My features PostGIS is MULTIPOLYGON
Related issue(s): #16497 (duplicates)
Redmine related issue(s): 7555
The text was updated successfully, but these errors were encountered: