Hi,
I'll try to make you an example for FME Workbench ...
but let's get back to Python. All Arctoolbox-Functions are accessible
through Python.
A simple Python script like this:
# Import system modules
import sys, string, os, win32com.client
# Create the Geoprocessor object
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
gp.setProduct("ArcView")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Linear
Referencing Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management
Tools.tbx")
events_dbf = "C:\\temp\\events.dbf"
try:
# Process: Make XY Event Layer...
if gp.exists(events_dbf):
gp.Delete_Management(events_dbf)
# Process: Locate Features Along Routes...
gp.LocateFeaturesAlongRoutes_lr(yourPointLayer, yourRouteLayer, routeID,
tolerance, events_dbf, Output_Event_Table_Properties, "FIRST", "DISTANCE",
"ZERO", "FIELDS")
allows you to call that ArcToolbox tool through Python.
Have a look into "Writing Geoprocessing Scripts"
http://support.esri.com/index.cfm?fa=knowledgebase.documentation.viewDoc&PID=43&MetaID=1003
You can also generate such a script by clicking "Export" in the Modelbuilder
window!
but enough of ESRI Pyhton Scripting on the FME list. I'll shut up:)
I'll try to set up an example workspace and i'll put it on fmepedia ...
Greetings,
Jeff
On 3/3/07, grant.huntington <[EMAIL PROTECTED]> wrote:
Hi Jeff, thanks for the help! Unfortunately...I still can't get it.
*
Expose the "geodb_mesures" field of your destination feature type.
*
Done, as well as for the source polyline (although in this case they are
shape_measures)
*Convert your line to points (Chopper)...
*Sounds good, but the measures don't get carried over like we expect.
Source dataset to Chopper to AttributeSetter to Visualizer (or Destination
dataset) and the measure field is empty. I tried Char and Num datatypes.
Maybe I'm doing something else wrong?
*
...then snap your points to be located to the nearest of this points
(Neighbourfinder)....
**Attention: If you use an AchoredSnapper, it will always snap to a vertex
and not to the edge!*
*The "Locating Features Along Route" - function in ArcView also snaps to
the edge!*
I used the AnchoredSnapper because it snapped to the closest point.... I
found that (please correct me if I'm wrong) the Neighborfinder grabbed the
attributes of all the candidate features within the tolerance and put them
in a list which I assume then needs to be sorted by distance and indexed but
I really have no idea...that would be complex than I wanted :)
*You could write a batch script that calls your FME file throughthe
command line and afterwards a Python Script calling the "LocateFeatures
along line" from ArcView...*
Also sounds good but it seems that the ArcView working "Locate Features
Along Route" is in VBA?? I fully expected to find a script in the
<Install>\Arctoolbox\Scripts location.
*If you have FME ESRI Edition, you could extend the FME Extension for
ArcGIS so that you could integrate your FME Workbench logic into a
Geoprocessing model.
*I am going to look into that - I didn't even know it existed. Well kind
of, but well...did I?*
*
*Handling measures in FME 2006 GB is not easy.*
*In FME 2007 this should get easier*
Aha...Cheers to that - should be a great release
Thanks again,
Grant Huntington