GeoDaCenter / geoda

GeoDa: An introduction to spatial data analysis
http://geodacenter.github.io
GNU General Public License v3.0
705 stars 156 forks source link

Fix the bug "Can't save a read-only datasource". #220

Closed lixun910 closed 8 years ago

lixun910 commented 9 years ago

This is a bug after switching read/write shapefile from raw code to GDAL. So, there is a problem for write/save data to shapefiles for all the versions >=1.7.41.

Will fix this soon.

lixun910 commented 9 years ago

Julia, there is one issue: due to a shapefile file read issue, we switched to read/write all datasrouces using GDAL/OGR. However, to create a new field/column, GDAL will always append it to table. It doesn't support what GeoDa used to do "insert before" a selected field, because in some datasource (e.g. a database table), it is not possible to re-order the columns in GDAL unless you rebuild the whole table.

We can either switch back to read/write Shapefile using original GeoDa code, and support "insert before" function for a newly created field/column (there will be a bug when read some exceptional shapefiles), or we keep using GDAL but hiding the "insert before" feature and always "append to" the end of the table.

Let me know what's your suggestion.

screen shot 2015-09-03 at 4 18 39 pm

jkoschinsky commented 9 years ago

Hi Xun,

Append to the end of the table works fine. thx! Julia

On 3 September 2015 at 16:18, Xun Li notifications@github.com wrote:

Julia, there is one issue: due to a shapefile file read issue, we switched to read/write all datasrouces using GDAL/OGR. However, to create a new field/column, GDAL will always append it to table. It doesn't support what GeoDa used to do "insert before" a selected field, because in some datasource (e.g. a database table), it is not possible to re-order the columns in GDAL unless you rebuild the whole table.

We can either switch back to read/write Shapefile using original GeoDa code, and support "insert before" function for a newly created field/column (there will be a bug when read some exceptional shapefiles), or we keep using GDAL but hiding the "insert before" feature and always "append to" the end of the table.

Let me know what's your suggestion.

[image: screen shot 2015-09-03 at 4 18 39 pm] https://cloud.githubusercontent.com/assets/2423887/9673279/76c11658-5257-11e5-95ac-8a3545a4acb8.png

— Reply to this email directly or view it on GitHub https://github.com/lixun910/geoda/issues/220#issuecomment-137599303.


Julia Koschinsky, Ph.D. Research Director Associate Research Professor Arizona State University School of Geographical Sciences and Urban Planning GeoDa Center for Geospatial Analysis and Computation julia.koschinsky@asu.edu

http://geodacenter.asu.edu http://www.facebook.com/geodacenter http://twitter.com/GeoDaCenter

lixun910 commented 9 years ago

OK. Will do, and this will involve all the interfaces with "Insert before" option, and the title of the dialog will be "Append Variable" instead of "Add Variable", or replace "Add" button to "Append to Table" button. Sounds good?

jkoschinsky commented 9 years ago

Why don't we leave "Add Variable" since the only difference is that it's added at the end of the table instead of the beginning, right?

On 3 September 2015 at 16:25, Xun Li notifications@github.com wrote:

OK. Will do, and this will involve all the interfaces with "Insert before" option, and the title of the dialog will be "Append Variable" instead of "Add Variable", or replace "Add" button to "Append to Table" button. Sounds good?

— Reply to this email directly or view it on GitHub https://github.com/lixun910/geoda/issues/220#issuecomment-137600441.


Julia Koschinsky, Ph.D. Research Director Associate Research Professor Arizona State University School of Geographical Sciences and Urban Planning GeoDa Center for Geospatial Analysis and Computation julia.koschinsky@asu.edu

http://geodacenter.asu.edu http://www.facebook.com/geodacenter http://twitter.com/GeoDaCenter

lanselin commented 9 years ago

Was about to add this as a new issue when I saw this one. I have the problem even when appending a new variable at the end. Save does not work, but Export does.

Btw, the error message should change since Save As no longer exists

screen shot 2015-09-08 at 5 11 11 pm
lanselin commented 9 years ago

Sorry, clicked the wrong button, it should be open.

lixun910 commented 9 years ago

Yes, this is a bug when switch fully to OGR/GDAL. For current release 1.7.53, please use "export" for a temporary solution. The fix will be in next release.

On Tue, Sep 8, 2015 at 2:16 PM, Luc Anselin notifications@github.com wrote:

Sorry, clicked the wrong button, it should be open.

— Reply to this email directly or view it on GitHub https://github.com/lixun910/geoda/issues/220#issuecomment-138702631.

jkoschinsky commented 8 years ago

Verified with locked files in GeoDa 1.7.63 (save and export now work).