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
Improve SHPRead function ? #839
Comments
SHPREAD must create a primary key column. This thing is not possible with table result set. |
So you think that we cannot emulate a SERIAL column with a SimpleResultSet ? |
SERIAL is not a column type its an alias for auto increment primary key when creating tables. |
Ok. According to you it's not possible to do that ? |
It should be another function name. |
Maybe : SHPREAD -> Read a file |
Ok to distinguish the behaviours.
In both cases, a PK is added |
When the SHP is imported the data are stored in the database so you can do what you want in SQL. |
Yes I know but your initial question was to be able to make SQL selection during the import step (not once the shp is stored into a table) ? Isn't it ? |
It would be nice to support this syntax for all driver functions CALL SHPWRITE('/tmp/theshape.shp', '(SELECT * FROM geomtable where st_area(the_geom) >10000 )'); |
CALL SHPWRITE('/tmp/theshape.shp', '(SELECT * FROM geomtable where st_area(the_geom) >10000 )'[,encoding] ); is now supported |
@gpetit ping for doc |
I'm on it |
The |
SHPREAD has been updated with the signature :
Note that SHPRead doesn't support zip archive as entry |
Ok thanks |
It would be nice if the SHPRead function returns a ValueResulSet as CSVRead function. So the user will be able to do something like
SELECT SUM(ST_AREA(THE_GEOM)) AS total from (SELECT * FROM SHPREAD('/tmp/myFile.shp')) GROUP BY CODE_INSEE;
It is closer to the SQL syntax than "CALL SHPRead".
The text was updated successfully, but these errors were encountered: