Using transformers to modify data.
Recently active
Hello, everyone. I have points (attributes: X, Y, ID) and I want to merge points that are under 50 m distance and new point should have attributes ( new_ID, X, Y, all id of the points from which the new point was created) and if there is a duplicate point, also making one with attributes ( new_ID, X, Y, all id of the points from which the new point was created) Thanks a lot.
Hi there, I have Incident_no in the csv which I don't want to include into the calculation. Data is coming from the database. Is there any way that I exclude the records that contain incident number present in CSV? I tried with Feature joiner but it didn't give an option of not equal.
Using the logic from this post and this post, I wanted to rename my log file using the Pyhton shutdown script.For some reason, os.rename works only with python 2.7 and not python 3.x.I tried single, double, and triple quotes; used raw, and I can't seem to find a good way to correct os.rename. Used FME_macro and just a string for the source file. Nothing worked so far.# Import modulesimport fme, datetime, time, os# Get current date and timedateToday = datetime.date.today().strftime('%Y/%m/%d')timeNow = datetime.datetime.now().time().strftime('%H.%M.%S')logger = open(FME_LogFileName,'a')logger.write('Date: {}\n'.format(dateToday))logger.write('Time: {}\n'.format(timeNow))logger.write('ProcessID: {}\n'.format(fme.processID))logger.write('Status: {}\n'.format(fme.status))logger.write('Workspace duration was {} seconds\n'.format(fme.elapsedRunTime))logger.write('Total feature read {}\n'.format(fme.totalFeaturesRead))logger.write('Total features written {}\n'.format(fme.totalFeaturesWritten)
The output feature class based on the sample data should have 3 features (one per file) and 50 columns named and populated from all lines which include the symbol “=”, e.g line 7: LIDAR POINT COUNT=35,391,512, where the ColumnName is "LIDAR POINT COUNT" and the Value is "35,391,512".The polygon should be created using the UPPER LEFT X, UPPER LEFT Y, LOWER RIGHT X and LOWER RIGHT Y.The number of features will vary from file to file; another file might result in 312 features.I have managed to extract the desired rows and aggregate them into the requisite 3 features (see attached 2017 fmw), but am now stuck as to how to pull the attributes back apart and build the polygons...
I have an attribute string such as 6-6.35@4T. Where the 6 before the "-" is size (which can be a two digits such as 12). The characters between the "-" and the "@" are a depth measurement (and could also be something like 20.50). The number after the "@" is a clock position and can be in the range between 1-12. The alpha character at the end is indicative of a type. We captured the characters before the "-" as a size attribute. We did this using the string function - @Left(@Value(In_A),(@FindString(@Value(In_A),"-"))).What is stumping us is how to capture all characters between the "-" and "@" as a depth attribute and the numbers after the "@" as a clock position?We would like to accomplish this in the attribute manager if possible.Any help is much appreciated.
Hi, I am trying to make use of some code in the PythonCaller to work out the number of working days. I found this code that had been posted. import fmeimport fmeobjectsfrom datetime import timedeltafrom datetime import datetime(MON, TUE, WED, THU, FRI, SAT, SUN) = range(7)weekends=(SAT,SUN)def networkdays(start_date, end_date, holidays=[]): delta_days = (end_date - start_date).days + 1 full_weeks, extra_days = divmod(delta_days, 7) # num_workdays = how many days/week you work * total # of weeks num_workdays = (full_weeks + 1) * (7 - len(weekends)) # subtract out any working days that fall in the 'shortened week' for d in range(1, 8 - extra_days): if (end_date + timedelta(d)).weekday() not in weekends: num_workdays -= 1 # skip holidays that fall on weekends holidays = [x for x in holidays if x.weekday() not in weekends] # subtract out any holidays for d in holidays: if start_date <= d <= end_date: num_workdays -= 1 return num_workdaysdef processFeature(feature): start_date = date
Just upgraded to 2019.0.2.0 and the BulkAttributeRenamer shows some unexpected behaviour, when an attribute's name contains special characters (in my case German umlauts "äöü", but I assume any non-ascii trigger the problem). Problem did NOT occur in 2017.1.2.The transformer's mode of operation (prefix, regex etc.) doesn't seem to matter: simply adding a prefix is enough to trigger the bug.Minimal example to reproduce:Create a feature with an attribute name, e.g. "ÄTTRIBUTE" = 1Add a prefix to it with BulkAttributeRenamer, e.g. "FOO_"Note you now have "FOO_ÄTTRIBUTE" as expected, but with an empty value (instead of =1) AND you still have "ÄTTRIBUTE" carrying the original value (only visible when inspecting all of the feature's attributes, i.e. click the row in inspector)Can anyone else reproduce this?
Hi,I have a lot of workspaces for FME 2018.1 that use PythonCaller and PythonCreator and log messages to both the translation log window, and the log file, with the logMessageString function, like this:def log(message, severity=FME_INFO): fmeobjects.FMELogFile().logMessageString(str(message)), severity) After upgrading to FME Desktop 2019.2.2, I noticed that FME will neither log to the translation window, nor write anything in the log file, when using logMessageString, or Python's own print function for that matter. I've tried both FME Python 2.7 (deprecated) and FME Python 3.7+. I have this workspace: My PythonCallers (print function included just for additional testing): Running the workspace produces this translation log: Command-line to run this workspace: "C:\Program Files\FME Desktop 2019.2.2 x64\fme.exe" C:\FMEDataTemp\FME2019-Python-logger.fmw Starting translation...2020-01-13 11:35:41| 1.0| 1.0|STATS |Storing feature(s) to FME feature store file `C:\TEMP\wb-
We've just upgraded an FME server from 2018.1 to 2019. When running any of the workbenches that have the python interpreter set to "ESRI ArcGIS Desktop (Python 2.7)" the FME engine mysteriously crashes and restarts the job when it hits the python code. I cannot find any reason for this. If I switch it to the Python 3.7 interpreter the workspace fails with a python error, which I'd expect because its the wrong python version, but at least the server engine doesn't restart itself. Has anyone seen this behaviour and any idea what could be causing it? Using 64-bit FME, 64-bit python and 64-bit ArcGIS.
Hi there, We have a a problem reading a WFS with FME Workbench 2019.0. (ArcGIS Pro). We're using two datasets, If we check the data in ArcGIS Pro both datasets have overlap and the same coordinate system: When we read the same data in FME using the default coordinate reference system, we see the following: According to the translation log the following happened:FME Configuration: Using ESRI Reprojection Engine CS-MAP Reprojector: Transformation will be automatically selected for 'LL84' -> 'EPSG:23031', and is not guaranteed to remain the same in future releases of FME Reprojector: Using transformation `ERP50-W_to_WGS84,Inverse(Multiple Regression)' when reprojecting from LL84 to EPSG:23031 We tried to use the Reprojector and the EsriReprojector to change the coordinate reference system without success. Also changing the coordinate reference system in the reader itself was not successful. Help or advice would be highly appreciated.
Hello, I am dealing with XML files that contain more than 300 attributes deeply nested within lists, and the records present point data. The final goal is to extract and flatten all the data that is there and covert it further into a gdb. What I was doing so far was flatten the XML through the XML reader, and then use Attribute Exposer to expose as many lists and list elements as possible. However this is quite time consuming since every element contains lists that need to get exposed, and does not create a unique solution for all the XMLs that I have. Moreover, the extent is different in every XML, for example I choose to expose certain elements based on a reference XML file: Content.Base.Relationshiplist.Relationship.Referencelist.Reference{0}.ReferenceID Content.Base.Relationshiplist.Relationship.Referencelist.Reference{0}.ReferenceID.type Content.Base.Relationshiplist.Relationship.Referencelist.Reference{0}.ReferenceID.primary Content.Base.Relationshiplist.Relationship.Referenceli
Hi there! I am working on a specific analysis. This analysis needs to calculate 13 000 ha of parcels (area) randomly and then assign a new attribute value to this. Right now I have the following workflow:I thought I could make this work by calculating the percentage and then use the Sampler to randomly select parcels, but this doesn't work because the sum of ha does not add up. What I am looking for is a tool that allows me to use the following formula:"Random amount of parcels added up" = 13 000 haSo I guess it is a randomized sampler using a certain value based on attribute values. Does anyone have any idea how to do this? Thank you so much in advance!
Hi there, I'd like to find out if there is a way to generate a sample of my data based on a measurement instead of a count?The Sampler transformer seems to do the calculations based on counts of features, but what I need is, for example, say I have 1000 kilometers of road geometry, and I want a random sample of 50 km.Is this possible? Thanks in advance,
Hello There I don't know why the point on the same side of the centerline some show left and other show rightI have attached the workspace if some can help to understand this
Hi!!! I have a project need to cut these (M)lines by lengthfor example: there are line 1 is 13 miles long and line 2 is 16 miles long.I need to chop these 2 line by every 5 miles. as I have picture below, line 2 begin measure at 3th mile not 0.any idea how to do this? thanks
Hi guys,I have a table with an attribute 'Ingebruikname'.This field contains a year, month and day and info in hours. For example: 2019-01-11T13:05:00.000. I created a regular expression to select only the part with information about year, month and day. Like:2019-01-11T13:05:00.000I would like to get my attribute 'Ingebruikname' updated to records with only date infromation as shown in bolt. Records with no data for 'Ingebruikname' should be included as well and left empty.Do you have any ideas how to solve?
Hi all, I'm trying to determine how to remove the column header option when selecting Table as the content type in the MSWordStyler parameters. The reason for this ask is because I'm building a report and wanting to remove that blank space above my tables - since I'm not populating the header. If there was a option for this, these reports would look more professional.https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/mswordstyler.htmTable Parameters ClosedTable Style ClosedWidth Units OpenColumn Header The header text for the particular column. Format attribute set: msword_table_col_header*****Optional - ? COLUMN HEADER *******The header below is highlighted in grey.
So there might be already a way to do this, but will ask the question before submitting an idea.For complex Workspaces, especially those with high parallelism in the workflow, keeping a clean connector visualisation can be tricky. There are already several great enhancements that have been added that allow the user to route the connector line in different ways like Vertices, Tunnels and Junctions, however it all seems to get a bit manual trying to keep connectors routed around Bookmarks they don't actually interact with, especially if you drag a Bookmark box to somewhere else on the Canvas and then have to start shifting non-related Connectors around them again.I'm wondering if there is an option instead to NOT display the portion of a Connector that goes through a Bookmark, where it does not connect to any Transformer within that Bookmark? Tunnels kind of do this, but I find a different problem arises from using Tunnels because at higher zoom levels on the Canvas you start
Hi,I have a road network that I want to group on spatial basis. I want to group the roads on 3 valent or more junction on the basis of connectivity.I have tried using TopologyBuilder and ListElementCounter to calculate the node valency, but not getting how to group them.I have uploaded the data in the attachment. Thanks.
Hi community. I am looking to improve some workbenches and have them slightly more automated.The one I am currently working on revolves around some height of building data and is extracting the class from a string (example below). Currently I am using the AttributeValueMapper to convert this out manually but would be fantastic if there was a way to do this without setting it manually (if new data/classes are added we don't need to come back in and edit the Values to map.This is a screenshot of what is coming out of the AttributeValueMapper. The Condition attribute is the Source Value and the lay_class attribute is the destination value.The class I am extracting is the capital letters (one with number, but there will be more in the future) towards the end of the string. I know there is a regex expression to extract uppercase letters which is the closest to an automated solution that I have found (the condition includes more than one uppercase character) so it may be a combo of that
Hi, FME topics are not triggering from cityworks Action manager, FME throws a bad request error. I assume there is some special configuration required on Subscriptions / topics in order for Cityworks to work? Any help is appreciated. @nathanatsafe
I want to join multiple unit tables to one main geometry table based on one common_id field. The scenario as follows Main_Table1 ===> Unit_Table1Main_Table1 ===> Unit_Table2Main_Table1 ===> Unit_Table3 Main_Table2 ===> Unit_Table1Main_Table2 ===> Unit_Table3Main_Table2 ===> Unit_Table4Main_Table2 ===> Unit_Table5 Main_Table3 ===> Unit_Table1Main_Table3 ===> Unit_Table5Main_Table3 ===> Unit_Table6Main_Table3 ===> Unit_Table5 The main table is having the geometry and the unit tables are having the attributes. One unit table contains attributes of multiple geometry tables as shown above.
Hi A layer from cad has geometry and annotations. I need to convert this cad file to a shapefile and use the annotations as attributes. The annotations are delimited by points. For example: 3.-7.-9 ->should become: attribute 1= 3attribute 2= -7attribute 3= -9 What I already have: (check only the upper part) I load in the layer from the cad fileI use geometry filter to split out the annotations from the polygons. On the annotation part I use a string searcher to only keep the annotations with points in them (delimiter)Then I use this string searcher to divide the string in parts delimited by a point:The I use the ListElementExtractor to put the parts in attributes: Then I put the annotation part and the geometry part together in an attribute creator, were I create some new attributes that I fill in with attribute 1,2 and 3 from the annotation part. But after inspecting the output of the ListElementExtractor I see 4 objects.2 geometries with non of the attributes filled in and 2 anno
Hi, I know there are already threads about inserting images into Excel spreadsheets but I could not find a solution for my problem yet. In my workspace I create an image with MapnikRasterizer and a table, both of which I would like to write to Excel. For that purpose I created a template that is used in the writer. I define the cell location for the image in an AttributeManager but in the output it overlaps the table instead of being inserted into the defined cell. I'm sure there is some writer setting I'm setting up incorrectly but I just can not figure out which one. Example workbench and template are attached. Thanks for any help!
Good evening at everyone.SINFI (National Information System for Italian Infrastructures) requires that the data be delivered to the reference system EPSG:6875 [1]The SRS EPSG:6875 is called "RDN2008 / Italy zone (N-E)", based on the "RDN 2008" Datum.The "Rete Dinamica Nazionale 2008", is the evolution of "European Terrestrial Reference Frame 2000" (ETRF 2000) . The RDN2008-ETRF2000 system is the new official Italian reference system since 2011 (D.M. del 10/11/2011) [2][1] http://epsg.io/6875 [2] http://geomappando.com/wp-content/uploads/2016/07/DM-ETRF2000-RDN.pdf I have configured as follows a custom "DATUM_DEF" and a custom "COORDINATE_SYSTEM_DEF" in my "MyCoordSysDefs.fme" file:ELLIPSOID_DEF GRS_1980 \ DESC_NM "GRS_1980" \ E_RAD 6378137 \ P_RAD 6356752.314140DATUM_DEF RDN2008 \ DESC_NM "Rete_Dinamica_Nazionale_2008" \ SOURCE "PROJ4" \ ELLIPSOID GRS_1980 \ USE 7PARAMETER DEL