|
POST
|
I am assuming that you are searching a directory for the Plan files...... Here is an Idea to get you started...this if not very efficient but I do not have a lot to go on but guesses: Imports System
Imports System.IO
Function GetFileInfo(FacilityNumber as string) as string
Dim GFI as string
GFI = ""
' Make a reference to a directory.
Dim di As New DirectoryInfo("S:\DPW\Eng Record Management\Floor Plans\")
' Get a reference to each file in that directory.
Dim fiArr As FileInfo() = di.GetFiles()
' Display the names of the files.
Dim fri As FileInfo
For Each fri In fiArr
if left(fri.Name,3) = FacilityNumber then
GFI = fri.name
exit for
end if
Next fri
if GFI = "" then
GetFileInfo = "No Plans Found"
else
GetFileInfo = GFI
End Function
... View more
06-13-2016
09:01 AM
|
0
|
0
|
706
|
|
POST
|
Sometimes working out the problem for your self is the best path in learning. I generally use create routes from the linear referencing tools and my comments where under the assumption you were doing the same. I am glad you were able to resolve your problems.
... View more
06-10-2016
09:55 AM
|
0
|
0
|
1066
|
|
POST
|
I am sorry and from your description of your problem, I do not know where you are stuck? Typically, when I get summer interns and they try and create routes (m aware lines); it is because they do not have a line segment selected upon which to create the route (most common type of problem). ESRI does have help here: About using ArcMap to create routes from existing lines—Help | ArcGIS for Desktop From my interpretation of your problem you are trying to create routes(m aware line) based upon the rivers linework. Hope this helps you figure it out!
... View more
06-09-2016
07:03 AM
|
0
|
2
|
1066
|
|
POST
|
Making routes is pretty basic.... when issuing the make route command do you have the set of polylines selected? (ones that will become the route)
... View more
06-06-2016
07:55 AM
|
0
|
4
|
1066
|
|
POST
|
To add on to Dan's comments.... I am running version 11.0 in arcgis 10.4 without any problems (paid version). If you are using the same, their support is excellent as well as the documentation.
... View more
06-02-2016
10:03 AM
|
2
|
0
|
2928
|
|
POST
|
LOL I just got back to the office.... I only jumped in because it sounded like she only wanted to ignore those rows that had a character in it... When using python, now, I avoid nulls and put an empty/blank/unused code filter and delete in a two step process since I do not trust finding nulls yet in python. Liana I am happy you got it worked out! That's all the matters!
... View more
05-19-2016
09:07 AM
|
1
|
0
|
968
|
|
POST
|
If you want to simply blank out any entry in which GROUTE contains a letter then perhaps you could do this (test on a copy first!): Since GROUTE could contain letters then it cannot be a number.... GROUTE = "" if any(b.isalpha() for b in !GROUTE!) else !GROUTE!
... View more
05-18-2016
08:55 AM
|
4
|
7
|
2148
|
|
POST
|
Joshua, I do get the same results running the isnull script in SQL server as you, however when I import a record from excel with embedded codes, the isnull function returned true which differs from you singular controlled value list. In any event, I whole-heartedly agree with your statements, the other definitions I stated were not necessarily my own but view points of folks that supply me with data. I do not infer that the ASCII null is a universal standard of nullness, but gave it as one example of where the simple is none python test fails (for me!!!!! ). I believe my issue is not one of testing for null, but in data standards in which I am struggling to employ in-house as well as data received from the outside (lots of resistance in my case). I won't even go into uni-text,ut8 and binary strings/null issues... I do apology for letting out some frustrations and adding to the confusion to the poor soul who posed a simple question and the many solutions provided in the text of this chain; I am sure 99.9% would solve. I would love to do away with null values, but that is not a thought until I can get a handle on data standards. 99% of my job is not GIS/Engineering but Data Cleansing. So I can perform the other 1% with accuracy and consistancy.
... View more
05-10-2016
08:23 AM
|
0
|
0
|
1133
|
|
POST
|
Joshua, There are issues with nulls in all languages even my beloved vb and also with both the Oracle and MS SQL server -- so Python following the SQL standard is not 100% true either because each deals with nullness differently. So it is not really any specific language problem. My issue with Python's and Null is mostly personal. Python reminds me of the Perl scripting language (Which I really hated). I spend more time with python trying to figure out why an apparent record that both MSSQL ,ACCESS and EXCEL says its null but fails when testing in Python. In the end I use VB or other language scripts for null testing because I find the results both consistent and repeatable across time. VB, MS access, MS SQL treat Nulls slightly differently but in those cases I found I could handle the differences with little to no effort. VB distinguishes between space and nothing. Whereas MS Access does not except when you use the built in function as well as MS SQL. Oracle has more of a java/javascript approach to Null. But Python is very indirect and obscure when dealing with null within the language context (Probably makes Python much more flexible in the long run and can easily test all variants of nullness). I am probably not yet knowledgeable in Python to adequately determine which of the many variants I should test for. I think the problem is with the definition of what we consider is NULL. In my definition an empty string is not null, however nothing and null are same. Some other engineers I know disagree with my definition stating that nothing is also not null ... to them NULL is the absence of Nothing (that I cannot put my head around). Other folks will say that the < 31 ASCII Codes are nothing because they are artifacts from buffered cut and paste operation..... My ideal language tells me if something is null adhering to my expectation of nullness consistently. Python does not do this yet for me. My custom Python isNull function is constantly growing/being modified ... trying to capture and test for my definition of a null value. Did a little isNull test using different Languages and DB's for a test record from sqlserver that had a test field containing an ascii <NUL> and <TAB> char vb6 - isNull -- False vb.net isNull -- False / DB Context isNull -- true (go figure) python (test for none) -- False MS Access -- True MSSQL -- True Oracle -- False c # -- False and DB Context isNull -- true (same as VB.net)
... View more
05-05-2016
11:54 AM
|
0
|
2
|
1133
|
|
POST
|
Dan you just made my day! I am a LRS shop and NaN will be an issue when Python incorporates dynamic seg and measures.... nice that I have that to look forward to. Thankfully I wrote all my LRS code in VB.Net/ESRI SDK which will be around for awhile. I have read a few interesting papers about the possible redesign of VB, on which will incorporate and built around the HTML5 engine. If this comes to be, it will be a game changer and breath new life into vb script again!
... View more
05-05-2016
10:33 AM
|
0
|
0
|
1986
|
|
POST
|
In pure GIS tables I do not doubt your correctness about ESRI Nulls equating to None. However, in My real world, as a state authority, we are beggars of data and in many cases have little or no say in the formatting or the QA process the data we receive undergoes. Using my data, None is useless for testing for nullness ( hit or miss). The best pythonic approach I have used with my data is using the old fashion trim and concatenation approach to strip out all the Ascii codes 31 or less and final test for a single space or as many here indicated, assign a comparison number or string to represent nullness for the down and dirty. My clean approach, when I have time is to validate and correct the data before it gets into GIS (Then None and Dan's boolean approach works 100%). I still state that Python has issues with Nulls. It quacks like a duck, looks like a duck and feels like a duck -- But it is not a duck!
... View more
05-05-2016
08:56 AM
|
1
|
8
|
1986
|
|
POST
|
I have been working the last year converting to Python from VBA. I still have issues with Python's handling of NULLS! From my perspective results are almost always inconsistent; so my level of trust using Python to handle null is very low. I almost always use vbscript isnull() function to check. I learned something new thanks to Dan, I did not realize that nulls are treated as "false". Coming from a VB background nulls are neither True or False.... this concept may help me with my own inconsistencies with Pythons and Nulls. VB if IsNull(FieldX) then
FieldY = 'Calculation on FieldX being Null'
else
FieldY = 'Calculation when FieldX is not Null'
end if Another thing to check or to make sure that your tests includes Blanks,embedded tabs or other control character (see a lot of this when cut and pasting from excel)... these are not nulls although they act and appear to be nulls. These include all characters with ASCII values between 0 and 31. I made some tests using Python's of treating Null values as false .... works great if the data is clean... however on my "dirty tests" (real life cut/paste from external programs) I would still have to strip all embedded control characters before the Python script would work whereas the vbscript had no issues. PS... added later... This exercise has shown me that I have been lazy relying on VB to test for nulls... my data is not as clean as I thought it was....
... View more
05-04-2016
08:15 AM
|
1
|
13
|
1986
|
|
POST
|
To give a data concentric approach to your problem ... Traffic volume is generally analysed as a line segment along a road. The volume is calculated generally from traffic counters/meters (Point) and applied to a specific line segment along the road. First I would look for volumes as a line segment (not the traffic counter point) from you transportation department; here in the US this called AADT or Average Annual Daily Traffic. I am sure the Brits have a comparable analogous line layer of data. An attribute within the traffic volume data should be the road. Now to it is a simple matter to intersect your mammal sighting (point) to the traffic volume line segment. Once done the volume attribute will be added to your mammal point layer. Hopefully this gives you an alternative approach to your question. ----- Post edit ---- I wrote the above assuming that your point were located on or very near the associated roads. However, if you points are randomly located offset from the referenced roads then a more complicated process will be involved. Before intersecting the mammal points with the volume line segments you would first create a new mammal layer that is "snapped" to the referenced road. Tools mention by the experts in this post will get you partly there but you will still have points joining to the wrong road if the point is geometrically located closer to another road other than the referenced one... To accomplish this directly would involve some scripting or a series of manual filtered near analysis. My inhouse approach to this problem is to write a script that will loop through your mammal list, filter your road layer by the mammal point road reference (leaves you with only one road), snap the point to that "one" road. Continue the loop process throughout the complete mammal point list. When finished you will have a copy of your mammal points that rests on the correct road. Then you can perform your intersection with 100% assurance the correct volumes will be picked up. -- The python experts here can probably guide you through this in their sleep.
... View more
04-20-2016
07:54 AM
|
1
|
0
|
2326
|
|
POST
|
--- LOL --- Excel VLookup is soooooooo much more simple. Guess I am a minimalist.
... View more
04-19-2016
09:22 AM
|
0
|
0
|
584
|
|
POST
|
Adrian Just to add a little more to Rebecca's comments... I have a similar situation with updating maintenance needs on bridges. Our situation, we have many different consultants inspecting bridges all with different software systems and such ... but all had an excel spreadsheet in common. So I learned and applied a little vba programming to excel to "Standardize" and validate the excel form to match our domains and attributes... this being a little down and dirty has work out very well for us.
... View more
04-19-2016
09:16 AM
|
1
|
0
|
2213
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-18-2018 09:46 AM | |
| 1 | 05-23-2018 08:30 AM | |
| 9 | 04-18-2019 07:15 AM | |
| 1 | 05-04-2016 08:15 AM | |
| 1 | 03-24-2017 01:22 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-18-2023
06:40 PM
|