JSON/BSON geo file layout

   4665   2   0
User Avatar
Member
2 posts
Joined: Sept. 2013
Offline
Hello guys,

This question has been asked a billion times here, but I still can't find all the information that I need.

I need to implement json/bson (b)geo file importer for my application.
I saw that you've already implemented a parser in the toolkit libs.
Unfortunately I cannot afford adding more dependices to my project.

- Is there any open-source lib that can import bgeo/geo json format?
- Is there a public bgeo format spefication? If there is any I could implement it.
User Avatar
Staff
2675 posts
Joined: July 2005
Offline
Kostadin Petkov
Hello guys,

This question has been asked a billion times here, but I still can't find all the information that I need.

I need to implement json/bson (b)geo file importer for my application.
I saw that you've already implemented a parser in the toolkit libs.
Unfortunately I cannot afford adding more dependices to my project.

- Is there any open-source lib that can import bgeo/geo json format?
- Is there a public bgeo format spefication? If there is any I could implement it.

If you have ASCII geometry, you can import the JSON using Python
import json
geo = json.load(open('foo.geo', ‘r’))

Interpreting the schema might be a bit trickier.

You can see one approach in $HH/public/hgeo. For example try running:
% hython $HH/public/hgeo/hgeo.py $HH/geo/defgeo.bgeo
User Avatar
Member
2 posts
Joined: Sept. 2013
Offline
Thanks for the quick response!

Forgot to mention… I want to import both ASCII and BIN files using C++.

I've tried to run hgeo.py (in Houdini 13.0.198.21)
/ -> hython $HH/public/hgeo/hgeo.py $HH/geo/defgeo.bgeo

line 973, in _ginfo fdata = hjson.load(fp)
RuntimeError: Error parsing JSON stream:
JSON ERROR: Error attempting to read 2 bytes of data (near byte offset 2510)
  • Quick Links