Code Monkey home page Code Monkey logo

Comments (5)

rhoneyager avatar rhoneyager commented on July 23, 2024

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.

RobinEke avatar RobinEke commented on July 23, 2024

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.

rhoneyager avatar rhoneyager commented on July 23, 2024

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.

DaveOri avatar DaveOri commented on July 23, 2024

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.

RobinEke avatar RobinEke commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.