Comments (5)
Comment-handling code is at apps/3d_structures_singlethreaded/shapeIOtextParsers2.cpp, around line 540.
while ((pNumStart[0] == '#' || pNumStart[0] == 'N' || pNumStart[0] == 'n') && pNumStart < pb) {
const char* lineEnd = strchr(pNumStart + 1, 'n');
pNumStart = lineEnd + 1;
}
Do your comments start at the beginning of the line, or is there space before the "#" symbol?
from libicedb.
I use spacing after #, but I've tried files where no spacing was used as well and they fail as well.
One test case I've tried, that fails, literally only contains these lines:
# test
7 5 0
I've attached the file in question:
test.shape.tar.gz
from libicedb.
Okay, I've committed changes to the master branch to handle these cases. This shape now parses properly.
There were three problems:
- The shape was being mistakenly identified as a DDSCAT file.
- When comments were detected, the code was searching for the wrong end-of-line character ('n' instead of '\n'
- The parser from a much older version of the code did work; looks like subsequent changes subtly broke the parsing code.
Parsing text is always rather awkward. Would you mind sending me a few small shape files (also @DaveOri)? These can be used as inputs for a verification program to ensure that the code is working correctly, and to ensure that we do not accidentally break the code in the future.
from libicedb.
I have created a folder "samplefiles" in the master branch with some files within already.
It might address @rhoneyager needs and serve as a repository for future automated testing
from libicedb.
Thanks Ryan.
Importing seems to work for my shape-files now. I've put some example files into the ftp.
from libicedb.
Related Issues (20)
- DDSCAT-type shape files of various versions HOT 1
- Scattering element ordinal number HOT 1
- Negative dipole coordinates HOT 2
- Variable description HOT 2
- particle_scattering_element_coordinates HOT 2
- particle_single_constituent_name HOT 1
- particle_id HOT 1
- particle_scattering_element_spacing missing HOT 6
- Meta-Data for each file
- Index file?
- Particle shape comparisons for 5/17 meeting HOT 4
- Import heterogeneous particles HOT 2
- Shape file filename extension HOT 1
- Unit test functions HOT 4
- Mailing list server is not working HOT 2
- Update spread-sheets of 3D structure HOT 8
- Bug: scattering_element_coordinates_units not applied to PSU flakes
- Bug: throws from within a plugin do not propagate to the main application
- Update HH to read in string attributes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libicedb.