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

Problem reading .csv header #390

Closed jkoschinsky closed 7 years ago

jkoschinsky commented 8 years ago

GeoDa 1.7.103 (OSX Yosemite, 10.10.5)

I read this test csv into GeoDa, where one of the variable names consists of numbers only. In this case, GeoDa doesn't recognize the first row as a header row and instead adds automatic field names and an extra first row.

Question is if it possible to still recognize the header row for cases like this.

Here's the test file: test2.csv.zip

lixun910 commented 8 years ago

That’s how OGR behaves. The fix is easy as just rename the field name from a pure number to something starts with a letter. We can add a dialog to let user choose which row is field name, even the field type (like excel). Then create a csvt file for OGR reading. However, it will take some time. Let me know if you want this feature in current release.

On Apr 6, 2016, at 1:53 PM, jkoschinsky notifications@github.com wrote:

GeoDa 1.7.103 (OSX Yosemite, 10.10.5)

I read this test csv into GeoDa, where one of the variable names consists of numbers only. In this case, GeoDa doesn't recognize the first row as a header row and instead adds automatic field names and an extra first row.

Question is if it possible to still recognize the header row for cases like this.

Here's the test file: test2.csv.zip https://github.com/lixun910/geoda/files/207325/test2.csv.zip — You are receiving this because you were assigned. Reply to this email directly or view it on GitHub https://github.com/lixun910/geoda/issues/390

jkoschinsky commented 8 years ago

I would log it for the future since it's more of an edge case.

On 6 April 2016 at 13:57, Xun Li notifications@github.com wrote:

That’s how OGR behaves. The fix is easy as just rename the field name from a pure number to something starts with a letter. We can add a dialog to let user choose which row is field name, even the field type (like excel). Then create a csvt file for OGR reading. However, it will take some time. Let me know if you want this feature in current release.

On Apr 6, 2016, at 1:53 PM, jkoschinsky notifications@github.com wrote:

GeoDa 1.7.103 (OSX Yosemite, 10.10.5)

I read this test csv into GeoDa, where one of the variable names consists of numbers only. In this case, GeoDa doesn't recognize the first row as a header row and instead adds automatic field names and an extra first row.

Question is if it possible to still recognize the header row for cases like this.

Here's the test file: test2.csv.zip < https://github.com/lixun910/geoda/files/207325/test2.csv.zip> — You are receiving this because you were assigned. Reply to this email directly or view it on GitHub < https://github.com/lixun910/geoda/issues/390>

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/lixun910/geoda/issues/390#issuecomment-206564335


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 8 years ago

same issue as #459

jkoschinsky commented 8 years ago

GeoDa 1.8.13.5, OSX

It loads correctly now but replaces all field names to field_1, field_2 etc. (see below). If someone has lots of variables with one that has a numeric name, then renaming all is really frustrating.

Is it possible to only rename the numeric one instead of resetting all?

screen shot 2016-09-15 at 10 41 43 am screen shot 2016-09-15 at 10 41 52 am
lixun910 commented 8 years ago

This is a special case that first row has an integer number as field name, so OGR treats the first line as data not header (field names).

Will add an checkbox option in the dialog to allow user specify first row is data or header.

On Sep 15, 2016, at 10:44 AM, jkoschinsky notifications@github.com wrote:

GeoDa 1.8.13.5, OSX

It loads correctly now but replaces all field names to field_1, field_2 etc. (see below). If someone has lots of variables with one that has a numeric name, then renaming all is really frustrating.

Is it possible to only rename the numeric one instead of resetting all?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

lixun910 commented 7 years ago

GeoDa will automatically detect header, and separator.

jkoschinsky commented 7 years ago

GeoDa 1.8.15.5 — Mac OSX

problem persists with these two test cases: test.zip

jkoschinsky commented 7 years ago

GeoDa 1.8.15.9 — Mac OSX Confirmed fix:

screen shot 2017-01-13 at 6 20 36 am