|
POST
|
If your required context is for a year only why not use a integer field instead of a date field? However, if you want to assign a Year only within a date field, then you would have to chose a default value for your Month and day as Darren Wiens link indicates. If changing your date field to an integer is not an option you can use the the following script and substitute your own default month/day.... CDATE("1/1/2016") Note in vbscript if memory serves right Date() returns the system date......
... View more
09-22-2016
08:26 AM
|
1
|
1
|
2036
|
|
POST
|
That is the same chicken and egg situation I am in now.... I had two create two version one in 3.5 for the older ArcMap and 4.5 for the 10.4 I could not figure out any way around it fortunately for me the same code compiled in both. 10.4 requires net 4.5 compile. Unless you want to make a complete stand alone application (not an addin) that would work with both.... that was not a choice for me -
... View more
09-09-2016
08:14 AM
|
0
|
1
|
3920
|
|
POST
|
Are your addins written in Net 3.5 or less? If so they must be updated to 4.5 or better.... This was an issue I had porting old addins to 10.4 (Note: I did not have this issue in 10.3)....
... View more
09-08-2016
10:25 AM
|
0
|
3
|
3920
|
|
POST
|
Unfortunately, I was born before the digital age..... I have a big library of code print-outs!
... View more
08-31-2016
11:30 AM
|
0
|
0
|
2642
|
|
POST
|
I concur.... I cannot tell you how many times I have used old 'VBA' code as a reference guide in re-coding apps and tools to the new python/net. Although the code is not valid ... the techniques and principles are!
... View more
08-31-2016
09:34 AM
|
4
|
2
|
3099
|
|
POST
|
...... gotta love VB! I just works! BTW: if you are using vbscript .... Val([yourField]) will work stripping the spaces and non numeric text....
... View more
08-30-2016
07:05 AM
|
2
|
0
|
7367
|
|
POST
|
I also saw ... need only the suffix returned (Dr, Blvd, St, Pkwy) ... Just giving a little experience .... I deal with transportation... but need something similar... only the last word in string.... turned into a nightmare --- (I had a bunch of Johnson Dr. ---- got instead a bunch Johnson's no drives -- )
... View more
08-19-2016
09:00 AM
|
0
|
1
|
1689
|
|
POST
|
I don't deal with addressing much... what little bit I had to deal with frustrated me to no end... there are no one standard for addressing so the last word in the string may not be the street type, could be a range, box number ..... so if you are looking to pull out the street type, street name ect.... what you need is a more comprehensive app to do so; an address parser..... that said... I did have some luck with an old parsing python script I found and modified slightly to fit my needs... as you can see it is more involved than the simple field calculator scripts and still at least for the Miami area is only 90% effective in parsing.... I do not remember the source of the original script so my apologies to the person who hard effort went in making it. from pyparsing import *
def ParseAddress(address):
# define number as a set of words
units = oneOf("Zero One Two Three Four Five Six Seven Eight Nine Ten"
"Eleven Twelve Thirteen Fourteen Fifteen Sixteen Seventeen Eighteen Nineteen",
caseless=True)
tens = oneOf("Ten Twenty Thirty Forty Fourty Fifty Sixty Seventy Eighty Ninety",caseless=True)
hundred = CaselessLiteral("Hundred")
thousand = CaselessLiteral("Thousand")
OPT_DASH = Optional("-")
numberword = ((( units + OPT_DASH + Optional(thousand) + OPT_DASH +
Optional(units + OPT_DASH + hundred) + OPT_DASH +
Optional(tens)) ^ tens )
+ OPT_DASH + Optional(units) )
# number can be any of the forms 123, 21B, 222-A or 23 1/2
housenumber = originalTextFor( numberword | Combine(Word(nums) +
Optional(OPT_DASH + oneOf(list(alphas))+FollowedBy(White()))) +
Optional(OPT_DASH + "1/2")
)
numberSuffix = oneOf("st th nd rd").setName("numberSuffix")
streetnumber = originalTextFor( Word(nums) +
Optional(OPT_DASH + "1/2") +
Optional(numberSuffix) )
# just a basic word of alpha characters, Maple, Main, etc.
name = ~numberSuffix + Word(alphas)
# types of streets - extend as desired
type_ = Combine( MatchFirst(map(Keyword,"ST BLVD LN RD AVE PASS "
"TRL PATH PSGE WAY LANE"
"CIR DR PKWY CT SQ "
"LP TER TERR PL".split())) + Optional(".").suppress())
# street name
nsew = Combine(oneOf("N S E W North South East West NW NE SW SE") + Optional("."))
streetName = (Combine( Optional(nsew) + streetnumber +
Optional("1/2") +
Optional(numberSuffix), joinString=" ", adjacent=False )
^ Combine(~numberSuffix + OneOrMore(~type_ + Combine(Word(alphas) + Optional("."))), joinString=" ", adjacent=False)
^ Combine("Avenue" + Word(alphas), joinString=" ", adjacent=False)).setName("streetName")
# PO Box handling
acronym = lambda s : Regex(r"\.?\s*".join(s)+r"\.?")
poBoxRef = ((acronym("PO") | acronym("APO") | acronym("AFP")) +
Optional(CaselessLiteral("BOX"))) + Word(alphanums)("boxnumber")
# basic street address
streetReference = streetName.setResultsName("name") + Optional(type_).setResultsName("type")
direct = housenumber.setResultsName("number") + streetReference
intersection = ( streetReference.setResultsName("crossStreet") +
( '@' | Keyword("and",caseless=True)) +
streetReference.setResultsName("street") )
streetAddress = ( poBoxRef("street")
^ direct.setResultsName("street")
^ streetReference.setResultsName("street")
^ intersection )
# how to add Apt, Suite, etc.
suiteRef = (
oneOf("Suite Ste Apt Apartment Room Rm #", caseless=True) +
Optional(".") +
Word(alphanums+'-')("suitenumber"))A
streetAddress = streetAddress + Optional(Suppress(',') + suiteRef("suite"))
return streetAddress.parseString(address, parseAll=True)
a = ParseAddress("611 NW 23 CT")
print a
print "Number: " + a.street.number
print "Name : " + a.street.name
print "Type : " +a.street.type
print
print "-----------"
if a.street.boxnumber:
print "Box:", addr.street.boxnumber
print a.dump
... View more
08-18-2016
07:43 AM
|
2
|
1
|
1689
|
|
POST
|
May want to also investigate whether or not the route has a badly formed multi-part? Just a thought... but your in good hands with Richard (the resident LRS guru!)
... View more
08-10-2016
07:16 AM
|
0
|
0
|
2900
|
|
POST
|
All interesting reasons.... let me give you a different point of view that was not expressed here so far. Geometry is only one aspect of GIS, attached to that geometry (in my shop) is allot of non spatial data that must be shared throughout my enterprise. I also have numerous non GIS users whom use this data in day to day business. Plenty have spoken on the spatial side... the other side of GIS is the data (information). -Using shapefiles is prohibitive (not impossible) in the sharing of data outside of exporting the data into excel spreadsheets. This causes major data currency problems. -Using the ESRI File GDB is much like using a shapefile. You cannot share data beyond the ESRI product without exporting the data. There are only buggy beta ODBC drivers to this data set. Hooking up other products MS Office, reporting software etc is not yet possible. (Critical drawback) -Hybrid Database (PDB) MS Access. This allows for the sharing of data outside of ESRI products. Under certain conditions, multiple users can access the data simultaneously. Cheap version of an GDB enterprise database. -GDB (SQL server, Oracle etc). Expensive, intensive maintenance and more complex. However, allows for scaling, concurrent editing and sharing of data outside of any given software product. My shop is planning on implementing an Enterprise Database (future) as the needs and scale dictate. Cost/Benefit/Risk does not allow me to migrate to an enterprise solution at present. However, I have designed a hybrid PDB system to maximize the concurrent sharing of data throughout our agency. The data and spatial data is shared through front end MSAccess DB's that contain links to the various PDB's (ESRI MS Access) and shapefiles (yes we still have few roaming around). Esri's PDB (MSAccess) is an old version of access...our front ends are the latest MS Access software versions so we are able to share the data that is attached to the geometry throughout the enterprise. Almost all third party, without exception, can link with MS Access either directly or indirectly through ODBC. Lastly, my final jump to enterprise, I hope, has been mitigated because I already have defined the rules on the sharing of the data, data is already in table format and has been normalized at least to the fourth degree. Hope this gives another perspective on your choices.....
... View more
07-26-2016
08:06 AM
|
0
|
0
|
3750
|
|
POST
|
Format your string. Double.ToString Method (String) (System)
... View more
07-11-2016
07:28 AM
|
0
|
0
|
3496
|
|
POST
|
I do not know what version arcmap you have so I am sending a descriptive picture that encapsulates what I did .... If this is what you were after.
... View more
07-07-2016
08:02 AM
|
1
|
2
|
3591
|
|
POST
|
I would like to add on to George Thompson comment.. Some things to consider when planning on the joins ... Common identifier between both roads sets (For the Join) Segmentation of the road sets. (One may be split by change in width, the other split by intersections for example) You may have to spent some effort in merging line segment into a "common rule" for both to avoid many to many relationships. Need to identify how you are going to deal with road data/geometry found in one set and not in the other (Sorry you will still have to deal with geometries... at least the rules on how the data is applied over the geometries) This can be a messy operation if the rules for both data sets are dramatically different. Outside of simple joins, there are no real templates to follow.
... View more
07-06-2016
09:02 AM
|
0
|
0
|
2502
|
|
POST
|
Would this be of any help? ..... I have use this for tab delimited files (excel style). 13.1. csv — CSV File Reading and Writing — Python 2.7.12rc1 documentation Just be sure you have: 1. No ASCII Null Data 2. UTF-8 Format or ASCII printable delimiters import csv
reader = csv.DictReader(open('somefile.txt', 'rb'), delimiter='\t')
for row in reader:
#do something more useful here
print row.get('new')
... View more
06-20-2016
09:34 AM
|
2
|
0
|
4255
|
| 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
|