Solved

Set georeference to extracted appearance

  • 21 March 2022
  • 9 replies
  • 3 views

Hello,

 

I am looking for a solution for extracting appearance from geometry to get raster's and then adding georeference to it.

 

Full problem:

I have geometries that are divided into multiple files that have ortho photo appearance on them, I want to get all the appearances and combine them into one raster. Then Ill read another geometry and append the raster to that one using geometry coordinates.

But when I use the AppearanceExtractor no georeference is added so I cant combine them into one or append them to the new geometry.

2022-03-20 23_55_40-Window 

Input geometry

 2022-03-21 00_08_31-WindowAny help would be appreciated, thanks.

icon

Best answer by caracadrian 21 March 2022, 18:37

View original

9 replies

Badge +20

After you extract the Appearences you need to get the bounds of each of the rasters (BoundsExtractor) then use _xmin/max, _ymin/max in RasterGeoreferencer set as Extents (you can figure out each corner as a combination of x and y, min and max).

Or, if the bounds come out around 0, get the bounds of the geometries before AppearanceExtractor.

Hi, thanks for the answer it almost works.

The raster's to come out around 0, but if I use the bounds of the geometry the corner rasters does not get the correct scale from the geometry.

2022-03-21 10_17_37-WindowDo you know if you can extract geolocation information from the appearance?

Badge +20

Hi, thanks for the answer it almost works.

The raster's to come out around 0, but if I use the bounds of the geometry the corner rasters does not get the correct scale from the geometry.

2022-03-21 10_17_37-WindowDo you know if you can extract geolocation information from the appearance?

@Samuel Engström​ I expected this behavior. I figured this thing out some time ago but I don't remember the details.

Can you provide some sample data so I can experiment on it and give a proper answer?

@Samuel Engström​ I expected this behavior. I figured this thing out some time ago but I don't remember the details.

Can you provide some sample data so I can experiment on it and give a proper answer?

Sure, ill attach it here "TestData.zip".

I really appreciate this. I will keep looking on my end as well.

 

 

Badge +20

@Samuel Engström​ I expected this behavior. I figured this thing out some time ago but I don't remember the details.

Can you provide some sample data so I can experiment on it and give a proper answer?

For what I can do today, you should use fme_appearance_texture_gen_info (use AttributeSplitter to get individual parameters) to calculate georeferenceing parameters for RasterGeoreferencer.

I can't find the old workspace to extract the math from it.

You can start from these two links https://docs.safe.com/fme/2021.2/html/FME_Desktop_Documentation/FME_Transformers/Transformers/appearanceextractor.htm

World file - Wikipedia

@Samuel Engström​ I expected this behavior. I figured this thing out some time ago but I don't remember the details.

Can you provide some sample data so I can experiment on it and give a proper answer?

For the first mesh I get the following info:

154834.82348632812,

6570529.508609505,

64.38243413526811,

0.999657830526673,

0.9652987528713471,

0,

0.02657576127956851,

-0.012725120367005571,

0.024531445519046402,

0.28744891573729375,

0.1485365074402989,

0.03189531055754419,

-0.31220172324035006,

0.0015376531510371265,

-0.02436261459550266

 

The first three seems to be XYZ coordinates, but not the mid or corner point. I don't understand what the other are, I cant find a connection between my values and the World file in the wikipedia link.

Badge +20

@Samuel Engström​ I expected this behavior. I figured this thing out some time ago but I don't remember the details.

Can you provide some sample data so I can experiment on it and give a proper answer?

Thi should be the meaning of the parameters:

fme_appearance_texture_gen_info

Badge +20

@Samuel Engström​ Some time ago I created a workaround for this situations.

I started from the asumptions that the mesh was a whole at first and it was tiled for eficiency purpose. We need to recreate the bounds of the original tiles so we can use the bounds to georeference the appearance rasters. Data inspector gave me this ideea when it first loads the meshes in 3D.

We use SurfaceFootprintReplacer to get the footprint of each mesh, Dissolver to dissolve the areas into one, BoundingBoxReplacer to get the original (untiled mesh) extents.

We use Tiler set to Tile Size 250x250 (I did statistics on the footprints to get a max area and figured out it should be 250x250 and selected Lower Left as Starting Corner because that fits the original meshes - so, I basicly winged it).

Use BoundsExtractor to get the original tiles bounds (folowed by Bufferer with a small value to trick SpatialRelator - not absolutely necesary but it gets rid of a lot of headeaches). This will be sent to the Requestor port of SpatialRelator.

In paralel use GeometryExtractor to put the geometries of the original meshes in an attribute folowed by SurfaceFootprintReplacer so we can use them in SpatialRelator. This will be sent to the Supplier port of SpatialRelator.

With the ports on SpatialRelator bussy we set it to Requestor Contains Supplier and send the Output port to GeometryReplacer with GeometrySource set to the _geometry attribute from GeometryExtractor.

Now we can use AppearanceExtractor and the RasterGeoreferencer set to x/y min/max obtained from the correct tiles.

To join them just use RasterMosaicker if you need to.

I have attached a sample workspace made from your sample data using my home licence (I left the office a couple of hours ago and your case looked very intersting and very familiar) that made it all posible. So, in the end, thanks to Safe for making it all posible 😊

@Samuel Engström​ Some time ago I created a workaround for this situations.

I started from the asumptions that the mesh was a whole at first and it was tiled for eficiency purpose. We need to recreate the bounds of the original tiles so we can use the bounds to georeference the appearance rasters. Data inspector gave me this ideea when it first loads the meshes in 3D.

We use SurfaceFootprintReplacer to get the footprint of each mesh, Dissolver to dissolve the areas into one, BoundingBoxReplacer to get the original (untiled mesh) extents.

We use Tiler set to Tile Size 250x250 (I did statistics on the footprints to get a max area and figured out it should be 250x250 and selected Lower Left as Starting Corner because that fits the original meshes - so, I basicly winged it).

Use BoundsExtractor to get the original tiles bounds (folowed by Bufferer with a small value to trick SpatialRelator - not absolutely necesary but it gets rid of a lot of headeaches). This will be sent to the Requestor port of SpatialRelator.

In paralel use GeometryExtractor to put the geometries of the original meshes in an attribute folowed by SurfaceFootprintReplacer so we can use them in SpatialRelator. This will be sent to the Supplier port of SpatialRelator.

With the ports on SpatialRelator bussy we set it to Requestor Contains Supplier and send the Output port to GeometryReplacer with GeometrySource set to the _geometry attribute from GeometryExtractor.

Now we can use AppearanceExtractor and the RasterGeoreferencer set to x/y min/max obtained from the correct tiles.

To join them just use RasterMosaicker if you need to.

I have attached a sample workspace made from your sample data using my home licence (I left the office a couple of hours ago and your case looked very intersting and very familiar) that made it all posible. So, in the end, thanks to Safe for making it all posible 😊

Wow, this is wonderful! Your explanation makes it really easy to understand all the steps.

Thank you!! :D

Reply