Answers for "CSV: dynamic structure creation from CSVT information" https://knowledge.亚搏在线safe.com/questions/69259/csv-dynamic-structure-creation-from-csvt-informati.html The latest answers for the question "CSV: dynamic structure creation from CSVT information" Answer by dollargis https://knowledge.safe.com/answers/69338/view.html

@takashi Thanks again, this works with sqlite and also with postgis.

Now I am trying parametrize it to prepare running this workspace on FME Server, but I am failing again.In the end, the namespace and table as well as the csvt-filename should be created from the published parameter wktfile

I have added attribute creators, but I don't see the point where I can feed them into the process.

Here is the workspace:wkt-import2k-worker-01.fmw

Admittedly I am still lacking understanding for some mechanisms here, but I will recieve training only after the deadline of the current project :(

Tue, 01 May 2018 08:59:21 GMT dollargis
Answer by dollargis https://knowledge.safe.com/answers/69297/view.html

@takashi: Thanks heaps!I am almost there, just the FeatureMerger is not yet correct:

Here is the workspace:wkt-import2k-worker.fmw, maybe the error is already at an earlier stage.

Mon, 30 Apr 2018 17:10:22 GMT dollargis
Answer by takashi https://knowledge.safe.com/answers/69271/view.html

This screenshot illustrates a BASIC way to create a schema definition (i.e.attribute{}.name, attribute{}.fme_data_type) from a CSV file and corresponding CSVT file.See here to learn more about schema definition (attribute{} list):Dynamic Workflows: Destination Schema is Derived from a Schema Feature

Note: this workflow doesn't contain a way to treat geometry fields (WKT, CoordX, CoordY etc.).Probably additional process to treat geometries would be necessary.

Mon, 30 Apr 2018 12:27:07 GMT takashi
Answer by dollargis https://knowledge.safe.com/answers/69267/view.html @takashi

thanks for offering support on this issue.

According to https://giswiki.hsr.ch/GeoCSV, csvt knows those data types:

  • Integer or "Integer".
  • Real or "Real".
  • String or "String".
  • Date (format "YYYY-MM-DD"), Time (format "HH:MM:SS+nn") and DateTime (format "YYYY-MM-DD HH:MM:SS+nn"), whereas nn is the timezone.
  • "WKT" (preferred over Point(X/Y)).All WKT geometry types are allowed: Point, LineString, Polygon, Multipoint, MultiLinestring, MultiPolygon, GeometryCollection, Arcs, ...(see OGC WKT).
  • "CoordX","CoordY" (preferred) or "Point(X)","Point(Y)".Two separate colums in either order and not necessary neighboring of type Integer or Float: one containing the easting coordinate, and another containing northing coordinate separated by a comma.
  • All values of that WKT column MAY contain the same geometry (sub)type.

Notes:

  • CSVT fields are separated by commas
  • Types can be in quotes ('"') or not, e.g. <<"Integer";"Real">>.
  • Types can have precision in parentheses, e.g.('Real(20.2)')).
  • There's only one geometry column per .csvt, "WKT".
  • A WKT field is stored in one single String column.

Mon, 30 Apr 2018 11:28:32 GMT dollargis
Answer by takashi https://knowledge.safe.com/answers/69263/view.html

Hi@dollargis, I don't think the SchemaSetter is helpful here.If you know the mapping rule between every possible CSVT type name (real, string, etc.) to corresponding FME generic data type fme_real64, fme_buffer, fme_int32, etc.), I think you can create schema definition based on the CSVT file and configure dynamic writer feature type.

Can you provide a comprehensive table of the CSVT types and their meanings?

Mon, 30 Apr 2018 10:46:18 GMT takashi