Skip to main content

Hi,

I'm creating line with measure on vertex and write it to postgis. When I read the same line from postgis, there is no measure.

Is-it possible to write and read measure from Postgis?

Thanks

@miladahmad Yes. FME can create PostGIS tables with measures. MeasureGenerator will create measures on a features. The first feature written to a table dictates the structure of the geometry. So make sure the first the features written to the table have measures.

The attached workspace illustrates this. The Sampler has the first feature skip the MeasureGenrator so the table is created with no measures. Remove the Sampler and the table will be created with measures.

Example workspace (FME 2020): PostGIS measures.fmwt

Alternatively, create the tables using pgAdmin or SQL in SQLCreator.


Thanks for your answer. I do the same but when I read from postgis, the line do not have measure. What do you mean by creating table with SQL? Should I write 2 tables or what? Simply, I have a line, I generate measure and write it to Postgis. Should I do something else?

Thanks


Hi miladahmad,

Are you writing to the same PostGis table as you are reading from in the workspace?

If so, I suggest you read the line from the existing PostGis table, add the measure to it and write it to a new table so that table has the spatial DataType with measure in it.

 

Put the original lines in that new table and use this table as input for adding the measures.

Kind regards,

 

Krien Guijt

Hi miladahmad,

Are you writing to the same PostGis table as you are reading from in the workspace?

If so, I suggest you read the line from the existing PostGis table, add the measure to it and write it to a new table so that table has the spatial DataType with measure in it.

 

Put the original lines in that new table and use this table as input for adding the measures.

Kind regards,

 

Krien Guijt

thanks a lot. It's working now. I find that it is strange that I should write the table 2 times.


Reply