Agisoft Metashape

Agisoft Metashape => Bug Reports => Topic started by: rossnixon on April 14, 2017, 12:46:52 PM

Title: Specification of Shape files, so I can see on model
Post by: rossnixon on April 14, 2017, 12:46:52 PM
When I import a 2D or 3D shapefile (polygon), to view on my model, sometimes they are visible, sometimes they are not.
If they are not visible, I try simplifying them to reduce the node count. That doesn't work, still invisible.
Then I tried a KML file, but got an error message - something like it couldn't accept it.

Is there a specification that always works?
Title: Re: Specification of Shape files, so I can see on model
Post by: Alexey Pasumansky on April 14, 2017, 12:49:22 PM
Hello rossnixon,

2D shapes cannot be displayed in model view. You need to use "update altitudes" first, providing that there's Digital Elevation Model generated and having values for every shape vertex.
Title: Re: Specification of Shape files, so I can see on model
Post by: rossnixon on April 14, 2017, 01:07:55 PM
Did you mean to say 2D, Alexey?
The polygon/region is just a external boundary around the most important part of the model. There is no data in it that is useful. I must be missing something in the specification about 50% of the time. The last time I created a shapefile to use, neither the 2D or the 3D versions became visible.
- do I have to remove spaces from the file name?
- do I have to remove data columns?
- do I have to use a polyline instead of a polygon?
Title: Re: Specification of Shape files, so I can see on model
Post by: Alexey Pasumansky on April 14, 2017, 01:20:55 PM
Hello rossnixon,

Shape may contain only XY for vertices or XYZ. The first case is 2D shape, the latter - 3D shape. In the model view only 3D shapes can be displayed, whereas in the Ortho view both types would be shown.

Can you send any example of the shape  that you have import problems with and also to specify the coordinate systems used for chunk referencing and for shapes?

Title: Re: Specification of Shape files, so I can see on model
Post by: rossnixon on April 14, 2017, 01:30:06 PM
I won't be back at work until Tuesday, so I'll see what I can test or send then. Thanks.
Title: Re: Specification of Shape files, so I can see on model
Post by: rossnixon on April 20, 2017, 06:36:20 AM
SHP files attached. For Alexey.
I imported each file, 2D and 3D, after aligning photos and observing GCPs. Both shapes are invisible.
Title: Re: Specification of Shape files, so I can see on model
Post by: Alexey Pasumansky on April 20, 2017, 11:01:36 AM
Hello rossnixon,

Which coordinate system is used for the chunk referencing?

Provided shapes do not contain any AUTHORITY referencing in the corresponding PRJ files, so if you have chunk georeferenced by EPSG code, you cannot combine it with the shapes that are referenced in the different coordinate system properly.

You can assign the coordinate system for chunk from the PRJ file that you have for the shapes and press Update button on the Reference pane. Alternatively, you can substitute the PRJ file for the shapes by the valid EPSG definition (export projection information from PhotoScan for the corresponding coordinate system EPSG::2193, unless I'm mistaken) and after that try the import.
Title: Re: Specification of Shape files, so I can see on model
Post by: rossnixon on April 20, 2017, 11:20:30 AM
I'm using the same coordinate system for GCPs and shapefiles. Sometimes the shapefiles are visible, but not this time.
Title: Re: Specification of Shape files, so I can see on model
Post by: Alexey Pasumansky on April 20, 2017, 11:49:50 AM
Hello rossnixon,

Can you post the screenshot of Chunk Info dialog (right-click on the chunk's label in the Workspace pane and choose Show Info option from the context menu)?

If I use project with the coordinate system imported from the PRJ files related to the shapes I can properly see the imported shapes in Model/Ortho view, so I assume that you might be using different coordinate system for chunk and shapes.
Title: Re: Specification of Shape files, so I can see on model
Post by: rossnixon on May 01, 2017, 09:46:58 AM
Sorry for delay in replying.

show_info screenshot is attached.

Also, I looked into shapes.zip\doc.xml. I see the following. I do not understand the different EPSG values. I would have expected some reference to EPSG:2193
    <crs>PROJCS["NZGD_2000_New_Zealand_Transverse_Mercator",GEOGCS["GCS_NZGD_2000",DATUM["D_NZGD_2000",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9102"]]],PROJECTION["Transverse_Mercator",AUTHORITY["EPSG","9807"]],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",173],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1600000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]</crs>
Title: Re: Specification of Shape files, so I can see on model
Post by: Alexey Pasumansky on May 01, 2017, 12:01:13 PM
Hello rossnixon,

The name of the coordinate system is different and the EPSG code is missing in it's definition, so it is not considered as same coordinate system.

You can substitute PRJ file that comes with the shape files with the PRJ exported from the chunk. Or perform the following assignment from the Console pane:
Code: [Select]
PhotoScan.app.document.chunk.shapes.crs = PhotoScan.CoordinateSystem("EPSG::2193")
Title: Re: Specification of Shape files, so I can see on model
Post by: rossnixon on May 02, 2017, 06:49:32 AM
Thanks Alexey,
Console command worked after I deleted the shapefile, reimported it & issued the command again.

Saved for future reference, as I'll need to do this when PRJ files are incomplete.
In fact I've saved a corrected PRJ file to use as a TEMPLATE. That gives me another option.