Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception error... #158

Closed
imakihi opened this issue Apr 1, 2024 · 3 comments
Closed

Unhandled exception error... #158

imakihi opened this issue Apr 1, 2024 · 3 comments

Comments

@imakihi
Copy link

imakihi commented Apr 1, 2024

Hi there.
I tried pg2b3dm with the simplest example. I prepared one simple polygon and run a command like this.
pg2b3dm -h myconnection.postgresbridge.com -U postgres -c geom -d postgres -t tmp

Then I got following.

Tool: pg2b3dm 2.6.0.0
Options: -h myconnection.postgresbridge.com -U postgres -c geom -d postgres -t tmp
Password for user postgres:
Start processing 2024-04-01T15:20:46....
Input table: tmp
Input geometry column: geom
App mode: Cesium
Spatial reference of tmp.geom: 4326
Spatial index detected on tmp.geom
Query bounding box of tmp.geom...
Bounding box for tmp.geom (in WGS84): 140.20479826, 41.42938574, 140.22322716, 41.43358218
Height values: [0 m - 0 m]
Default color: #FFFFFF
Default metallic roughness: #008000
Doublesided: True
Create glTF tiles: True
Attribute columns: -
Center (wgs84): 140.21401271450253, 41.431483959650905
Starting Cesium mode...
Translation ECEF: -3680072.5,3064596.25,4198470
3D Tiles version: 1.1
Lod column:
Radius column:
Geometric errors: 2000,0
Refinement: REPLACE
Geometric error used for implicit tiling: 2000
Add outlines: False
Use 3D Tiles 1.1 implicit tiling: True
Maximum features per tile: 1000
Start generating tiles...
Creating tile: 0_0_0.glb Unhandled exception. System.InvalidOperationException: Nullable object must have a value.
at Triangulate.PolygonExtensions.GetNormal(Polygon polygon)
at Triangulate.Triangulator.TriangulatePolygon(Polygon inputpolygon)
at Triangulate.Triangulator.GetTriangles(List1 geometries) at Triangulate.Triangulator.Triangulate(MultiPolygon multipolygon) at Triangulate.Triangulator.Triangulate(Geometry geom) at Wkb2Gltf.GeometryProcessor.GetTrianglesFromPolygons(Geometry geometry, Double[] translation, Double[] scale) in D:\dev\github.com\geodan\pg2b3dm\src\wkb2gltf.core\GeometryProcessor.cs:line 58 at Wkb2Gltf.GeometryProcessor.GetTriangles(Geometry geometry, Int32 batchId, Double[] translation, Double[] scale, ShaderColors shadercolors, Nullable1 radius) in D:\dev\github.com\geodan\pg2b3dm\src\wkb2gltf.core\GeometryProcessor.cs:line 26
at pg2b3dm.TileWriter.GetTriangles(List1 geomrecords, Double[] translation, Double[] scale) in D:\dev\github.com\geodan\pg2b3dm\src\wkb2gltf.core\TileWriter.cs:line 41 at pg2b3dm.QuadtreeTiler.GenerateTiles(BoundingBox bbox, Tile tile, List1 tiles, Int32 lod, Boolean addOutlines, String defaultColor, String defaultMetallicRoughness, Boolean doubleSided, Boolean createGltf) in D:\dev\github.com\geodan\pg2b3dm\src\b3dm.tileset\QuadtreeTiler.cs:line 108
at pg2b3dm.Program.<>c__DisplayClass2_0.

b__0(Options o) in D:\dev\github.com\geodan\pg2b3dm\src\pg2b3dm\Program.cs:line 187
at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action)
at pg2b3dm.Program.Main(String[] args) in D:\dev\github.com\geodan\pg2b3dm\src\pg2b3dm\Program.cs:line 27

I saw an output/content folder but the folder is empty. Can you help me to understand what I do wrong?
Thank you!

@imakihi
Copy link
Author

imakihi commented Apr 2, 2024

After I tride severl things, it worked now. I changed my geometry to polyhedralsurface. Then I could show my output.
I will keep trying but so far so good!
This is very exciting.
Thanks.

@imakihi imakihi closed this as completed Apr 2, 2024
@bertt
Copy link
Member

bertt commented Apr 2, 2024

Ok, Polygon should also work, did you add z values?

@imakihi
Copy link
Author

imakihi commented Apr 2, 2024

@bertt
I will go back and chec if I added Z values to my geometries. Thank you for your suggestion!
Best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants