Solved

SQL Server - Store the proper SRID in table with multiple geometry columns

  • 15 March 2022
  • 4 replies
  • 38 views

Userlevel 2
Badge +19

Good morning.

 

I have a table with two geometry fields in a SQL Server database. The coordinate system for both of them is EPSG:25830.

 

I've followed this article to be able to write both columns at the same time: https://community.safe.com/s/article/writing-to-tables-that-contain-multiple-geometry-c

 

It works great; but, when I check the SRID of both fields with the function STSrid, I get the 0 value for both of them instead of 25830. Before writing, I set the coordiante system with a CoordinateSystemSetter, so I don't know why it's not stored properly. That doesn't happen with tables with just one geometry column.

 

imageThe data comes from a DGN (v7) file. I'm using FME 2021.1.0.0. Am I missing something?

 

I've found this question with a similar issue from 5 years ago: https://community.safe.com/s/question/0D54Q000080hQwSSAU/multiple-geometries-with-different-srsid-

The last answer was by @mark2atsafe​  saying the devs were going to check it, but no further posts about it.

 

Thanks for any help provided.

 

icon

Best answer by markatsafe 17 March 2022, 19:01

View original

4 replies

Badge +2

@oscard​ I couldn't reproduce this in FME 2021.2. But perhaps that's because I'm using geography columns. I've attached my example. You can use the SQLCreators to create the table and query the SRID. If you want to alter this example to reproduce your issue I can take a deeper look. Looks like something we should ix in FME

Userlevel 2
Badge +19

@oscard​ I couldn't reproduce this in FME 2021.2. But perhaps that's because I'm using geography columns. I've attached my example. You can use the SQLCreators to create the table and query the SRID. If you want to alter this example to reproduce your issue I can take a deeper look. Looks like something we should ix in FME

Thanks for the answer.

 

I've checked your example and there is no big differences with my workspace. I can't share an example in a public forum, but I will open a case to attach it.

 

The case number is C671145.

Badge +2

@oscard​ FME can preserve the SRID on multiple geometry columns. To do this you need to set the geometry trait "Coordsys" with the coordinate system name that can be determined using the CoordinateSystemExtractor.

For each geometry:

  • CoordinateSystemExtractor and set the attribute "Coordsys"
  • GeometryPropertySetter with Traits from Attributes and the attribute Coordsys selected.
  • then aggregate the geometries and use the MultipleGeometrySetter

Example workspace attached (FME 2021.2)

Userlevel 2
Badge +19

@oscard​ FME can preserve the SRID on multiple geometry columns. To do this you need to set the geometry trait "Coordsys" with the coordinate system name that can be determined using the CoordinateSystemExtractor.

For each geometry:

  • CoordinateSystemExtractor and set the attribute "Coordsys"
  • GeometryPropertySetter with Traits from Attributes and the attribute Coordsys selected.
  • then aggregate the geometries and use the MultipleGeometrySetter

Example workspace attached (FME 2021.2)

Thank you! It's working now.

 

Before posting the issue I tried to do something similar with the GeometryPropertySetter, but I was using an incorrect name for the attribute. Is there any documentation where all the possible geometry traits are listed?

Reply