Enforcing unique values in field when editing in ArcMap?
I am working on a geodatabase. In some of my features, I would like to add a field, in which I will type the values on my own. On this field no duplicates must be allowed. In other words I want it to be a unique value field. I know ObjectID exists to certain uniqueness of the object, but I am working on a relational db and I want this field to be used as primary key.
I have tried adding a field and through access editing it as a "no duplicates allowed" field, but after that, I cannot edit in arcmap and the message "Warning: Unique index on non-OID field" appears.
You are not supposed to edit your personal geodatabase from MS Access since this may corrupt your geodatabase and introduce unexpected behaviour. In file and personal geodatabase, you are working with feature classes and tables each of which already has an unique ID field, i.e., ObjectID.
ObjectID, however, can be easily changed when a feature is updated or modified, so you should not depend on the ObjectID field in your database design. This field is used internally within the ArcGIS. Your option is to create a new field which you will take care yourself and make it a "key" field, however as you probably know each table can only have one unique index and it is already taken for the ObjectID field, that is why you are getting this kind of message. You will need to make sure that the field you will create yourself is unique through custom approach, such as setting up a geodatabase domain with pre-defined values, which user will be able to choose from. You could also use triggers to make sure that the values you enter into the field are unique.
If you need more advanced relational database design, you will need to move to an enterprise geodatabase, because the DBMS provides better support for this kind of operations. I have multiple feature classes with in SQL Server database that have unique constraints.
It is worth noting that, in ArcMap, when you edit attribute fields of an SDE feature class for which you have set the unique constraint in SQL Server, and try to enter an existing value in a field with defined unique constraint, you will get an error message and the value will not be entered.
Then you could use the Attribute Inspector (available from the Editing toolbar > Editor > Editing Options > Attributes tab). Check the Display the attributes dialog before storing new features option. This will allow you to enter attributes prior to writing rows to your database at the DBMS level.
You should create an index with unique constraint on the fields.
Just go to the property page of the table and then the index tab. Click the Add button.
This feature is only supported with ArcSDE SQL SERVER database. So with personal geodatabase it is not possible to have unique field in Arcmap and edit features.
As per Documentation:
Unique indexes The Unique option is not used in file geodatabases and can be left unchecked. The Unique option is available for SQL Server ArcSDE geodatabases; however, it is unavailable on the Add Attribute Index dialog box when the source data is a feature class that is registered as versioned.
When you create an index, you are presented with an option of creating the index as unique. Choose this option if the attribute has unique values in each record. This will speed query execution against this attribute, since the database can stop searching after the first matching value is found.
Note, however, that you cannot edit a feature class that has a unique index on a user-defined field in a personal geodatabase. Also, you cannot edit a feature class that is in a feature dataset with another feature class with a unique index on a user-defined field. When attempting to start editing a personal geodatabase, ArcMap returns this error:
Could not edit any of the map's layers. Check to see if a layer or table contains a unique index on a user managed column. If you have a unique index on a field in a personal geodatabase and need to edit, use ArcCatalog to drop the unique index and re-create it as a nonunique index.
Assign sequential attributes by sketching a line
In the Modify Features pane, Sequential Numbering applies an incremented attribute value in sequential order to a specified field name for each point, polyline, or polygon feature crossing a drawn line.
You can specify a number format and pad leading zeros. You can also include a prefix and a suffix commonly used by intelligent numbering schemes, such as parcel identification numbering systems to encode searchable information for indexing purposes.
The Modify Features pane appears.
The pointer automatically enters draw mode, and the construction toolbar appears at the bottom of the map.
The format specifies how a sequential number is written to a text field. Typing one or more # denotes the incremented sequential number. Examples are shown in the table below.
2 Answers 2
Using the ObjectID field as a unique key (which I assume is what you're doing here) is generally considered a Very Bad Idea, as that field is not as static as you might think - various operations on the dataset will re-assign them.
One of the answers to this question suggests that copy/pasting data might transfer the objectids intact, if you're copying data from somewhere else, but otherwise you should create another field to use as the unique key and leave the objectid alone.
(incidentally, this kind of geodatabase question will get much more intelligent answers over at GIS.SE.
The ObjectID is an internal system field for ArcGIS, and I such must not be tempered with. As stated in the help documentation,
The ObjectID is used by ArcGIS to do such things as scroll, display selection sets, and perform identify operations on features.
Instead, I would recommend creating a GlobalID, which is also system generated by ArcGIS but ensure that each identifier is unique (see ArcGIS field data type for details). The GlobalID also support geodatabase replication. To create a GlobalID, simply right-click on your feature classes, in ArcCatalog, and select Manage > Add Global IDs.
A short article on Tangier Island's unique linguistic heritage.
Geography, Human Geography, Physical Geography
This lists the logos of programs or partners of NG Education which have provided or contributed the content on this page. Leveled by
A five-kilometer (three-mile)-long fishhook-shaped piece of land in the middle of Chesapeake Bay, Tangier Island has always been a community set apart from the mainland.
Though just 19 kilometers (12 miles) off the shore of Virginia, the island&rsquos mostly Methodist residents chose not to join the rest of the state as members of the Confederacy when the United States Civil War broke out in 1861. More recently, Tangier&rsquos town council voted against allowing the 1999 movie Message in a Bottle to be filmed on the island because of the presence of swearing, sex, and drinking in the script. (The romance was ultimately filmed in Bath, Maine.)
These days, the island&rsquos 500-plus residents, who mostly use golf carts as transportation on the village&rsquos narrow roads and who don&rsquot allow the public consumption of alcohol, have managed to retain a great deal of their traditional culture.
Probably the most striking example of their heritage is the islanders&rsquo unique way of speaking.
What stands out most about Tangier residents&rsquo speech is their unusual pronunciation of common English words and their use of words and expressions that are only understood by islanders. In addition, residents employ a curious way of communicating that they refer to as &ldquotalking backwards.&rdquo
David L. Shores, author of the 2000 book Tangier Island: Place, People, and Talk, is a linguist who was born on Tangier Island. He has pinpointed the reason why the speech of Tangier Island strikes outsiders as odd.
&ldquoThey have a lot of idiomatic expressions, but the vowel system is quite different,&rdquo Shores says. &ldquoI mean, it&rsquos English. You can understand the people, but they have a tendency to prolong a vowel.&rdquo
According to Shores, the islanders pronounce their vowels louder and longer, which causes common words to sound different when uttered by Tangier natives. &ldquoIf you would take the words &lsquopull&rsquo and &lsquoPaul,&rsquo they would pronounce those the same way,&rdquo he says.
Some writers and scholars have said the natives of Tangier, an island that people believe has been inhabited since 1686, speak an old form of English that goes back to the time of Queen Elizabeth I, who ruled England from 1558 to 1603.
Shores doesn&rsquot buy into that theory. &ldquoIt&rsquos not Elizabethan English by any means,&rdquo he says. &ldquoI doubt if anyone could trace it to that, because the varieties [of English] at that time were great.&rdquo
Bruce Gordy, a Tangier native and a former teacher at the island&rsquos only school, has compiled a list of 350 expressions and words that he says are used and understood only by islanders. It includes the word &ldquowudget&rdquo for a &ldquobig wad of money&rdquo and the expression &ldquoin the sweet peas&rdquo to mean that someone is asleep.
&ldquoOn the mainland, if somebody has a bicycle and they get a flat tire then they have a flat tire,&rdquo he says. &ldquoWell, all of our lives growing up here, and even as adults, if somebody has a flat tire they don&rsquot say that. They say &lsquomy bike&rsquos bust.&rsquo It&rsquos just an expression we use here amongst ourselves.&rdquo
There are also a few obscure words that are derived from older forms of English. &ldquoThe reason Tangier people call &lsquoasparagus&rsquo &lsquospar grass&rsquo is because it came from the Colonial [English] &lsquosparrow grass,&rsquo&rdquo Gordy says.
But Gordy doesn&rsquot think it&rsquos the strange vocabulary that puzzles outsiders most when hearing Tangier residents speak.
&ldquoI think what confuses them is not so much the expressions or terms,&rdquo he says. &ldquoIt&rsquos the fact that we are &lsquotalking backwards&rsquo a lot.&rdquo
He offers up an example. &ldquoIf somebody&rsquos stupid, you know what I say?&rdquo Gordy says. &ldquoHe&rsquos smart. I&rsquom saying he&rsquos smart, but the way I say it and the emphasis makes everyone know I&rsquom emphasizing he&rsquos stupid.&rdquo
Gordy compares &ldquotalking backwards&rdquo to saying something sarcastically. &ldquoIf you want to emphasize how deeply the thing should be expressed, you say it with sarcasm,&rdquo he says.
Both Gordy and Shores believe Tangier&rsquos isolation has led to the islanders&rsquo singular way of speaking.
&ldquoI think it&rsquos the same way with your Welsh, your Ulster Scots, the Cornish people, the Irish people, and so on,&rdquo Shores says. &ldquoHere you have these communities that people came to early, but they have just been isolated. They have retained features that have passed out of Virginia speech.&rdquo
The economy of Tangier Island is moving away from its tradition of crabbing and fishing as the number of crabs and oysters in the bay plummets. More residents are finding work on tugboats or looking for jobs on the mainland.
Gordy fears this could have devastating effects on the islanders&rsquo way of life, including their speech.
Tangier&rsquos unique characteristics are &ldquoall tied to the water&rdquo and residents&rsquo intense focus on the island and its surrounding area, he says. &ldquoThat was what our whole life was. Of course the sons and daughters went with their dad out crabbing. You don&rsquot go with your dad on the tugboat. That&rsquos not going to preserve Tangier culture.&rdquo
Photograph by Bates Littlehales
Residents of Tangier Island, Va., have a unique vocabulary. Here are some expressions:
Geographic Information System (GIS) Professional Certificate
GIS technology has broad applications in natural and social sciences, humanities, environmental studies, engineering and management. The use of geospatial technologies continues to rapidly grow and values a certified workforce.
You’ll leave the GIS Professional Certificate program with knowledge in the newest GIS software and best practices for utilizing it in your field.
- Classes will focus on creating new features, editing, georeferencing and basic knowledge of web mapping, advanced GIS concepts along with hands on experience in specialty topics.
- Electives will be topic focused and provide a deep dive into a particular subject matter.
Unlike other GIS certificate programs, we’ll focus on how desktop GIS software transitions to web facing applications and the role web GIS plays into today’s organizations.
Additionally, students who complete the certificate will be eligible to sit for the ArcGIS Desktop Entry certification through Esri, the leading GIS software provider.
Taylor Holden, , GC, is a GIS Analyst at HDR. He is a former GIS Technician for the Spatial Analysis Lab (SAL) at the University of Richmond. He graduated from University of Richmond in 2015 after studying Geography and Environmental Studies, and earned a Master of Nonprofit Studies degree from the University of Richmond School of Professional & Continuing Studies in 2019.
Justin Madron is the UR Digital Scholarship Lab GIS Project Manager & Analyst. He has earned the Ersi ArcGIS Desktop Entry Certification. He is involved in GIS-related tasks and technologies required for the production and maintenance of the digital atlas of American history project. He has a BS in Landscape Architecture from West Virginia University and a master’s degree from Virginia Commonwealth University in Environmental Studies with a focus on Geographical Information Systems and Technologies. His thesis research was on the historical and present reforestation of red spruce in the Appalachian Mountains.
Program of Study
The GIS Professional Certificate consists of two core requirements — the GIS Fundamentals Certificate & the GIS Advanced Certificate — one elective and the portfolio studio. Completing the GIS Professional Certificate will position graduates to sit for the Esri ArcGIS Desktop Entry certification.
- Fall & Spring: GIS Fundamentals
- Summer: GIS Advanced
- Throughout the year: Electives
- As needed: Portfolio Studio
Our GIS Fundamentals Certificate is designed for professionals who wish to add GIS to their skillset and gather a broad understanding of the technology. The program provides a solid background in the fundamentals of geography and extends beyond a particular software program’s capability or features. Strong computer skills are encourage, especially experience in the Windows environment.
Key topics covered include:
- 5 parts of a GIS (hardware, software, data, people, methods)
- Data types: raster/vector
- Finding/evaluating data
- Data storage (geodatabases, shapefiles)
- Web GIS
This 15-week course will include many hands-on labs and will have an active classroom environment. We will dive right in using GIS software and applications to encourage open discussion. Each class will be a mix of lecture and lab activity.
Since the program is structured around technology, we will be using it in all facets of the course (ex: assignments will be shared and stored using Google Drive). We also believe students should be exposed to both open and proprietary GIS software.
The labs will be taught primarily in ArcGIS Pro but will include some open source exercises. We encourage students to explore both proprietary and open source software during the class and in their professional settings. Students will leave the course with an understanding of how to access ArcGIS and open source GIS resources for further learning, depending on software access and personal interest.
Our GIS Advanced Certificate is designed for professionals who wish to enter the field of GIS or to significantly add to their GIS skillset. The program provides a solid background in advanced topics of geography and extends beyond the basics of GIS and starts to uncover the possibilities of spatial analysis.
You’ll leave the certificate program with advanced knowledge in the newest GIS software and best practices for utilizing it in your field. Classes will focus on spatial analysis, spatial statistics, remote sensing and the power of web mapping and advanced GIS concepts.
Key topics covered include:
- Spatial Analysis
- Spatial Statistics
- GIS Scripting
- Advanced Geoprocessing
- Remote Sensing
This 12-week course is focused on developing more advanced Geographic Information Systems skills and going beyond the fundamentals. This is not an introductory course, so little time will be given to review introductory GIS concepts.
Students will have to demonstrate proficiency covered in the GIS Fundamentals Certificate, if students have not completed that program of study. It will cover more advanced topics and analysis tools in Esri’s ArcGIS Pro software. Spatial analysis, spatial statistics and scripting will be introduced.
At least one elective is required for the completion of the GIS Professional Certification. Elective classes and workshops covering a variety of GIS topics will be offered throughout the academic year. Topics may include drones, LIDAR, cartography and programming.
The following electives will be offered in annual rotation:
- will be offered in the spring semester each year will be offered in the summer and fall semesters each year
Additional topics will be offered periodically. Review the GIS, IT & Coding category for a listing of current offerings.
A one-day intensive workshop is required for the completion of the GIS Professional Certification. This studio workshop will give you the skills and knowledge to build a portfolio of work completed throughout your certificate education, and provide you a deliverable to demonstrate to potential employers the skills learned from coursework.
Students who complete the GIS Professional Certificate will be well positioned to sit for the Esri ArcGIS Desktop Entry certification which will validate skills learned in the classroom to potential employers. Students who complete the certificate can benefit from the combination of a professional academic certificate and a technical certificate in these ways:
- Build ArcGIS technical skills
- Grow experience with modern GIS applications
- Gain competitive edge in the job market
- Increase potential for job advancement opportunities and employment.
- Be able to demonstrate knowledge in concepts and theory along with technical skills
Esri-certified students can showcase their achievements through digital badging.
Modify ArcGIS Hub pages
The Police Transparency solution includes an ArcGIS Hub site and pages that your organization can configure with your own branding and share your organization’s story with the public.
Update with organizational information
After deploying the Police Transparency solution, the site and pages require a few updates to fit your local context. Consider what information you already have and what you can most easily find.
To update the Police Transparency site, complete the following steps:
- From the Customize window of the Site Home, select Header and Branding .
- Update the header to include your organizational icon.
- Change the name and short name of the site ( Police Transparency ) to a name that better reflects your specific organization.
- Browse to the Social Icons group and enter in the URLs for your agency's Facebook, Twitter, and Instagram accounts, or disable if you don’t want them displayed.
- Click Apply , then click Save to save the page, and click Publish Draft .
- From the Customize window of the Site Home, select Footer .
- Click the expand button in the right corner of the HTML section.
- Replace the default icon URL, department name, email address, and street address with the correct values for your organization.
- Enter the URLs for your agency's Facebook, Twitter, LinkedIn, Instagram, and YouTube accounts.
- Delete any icons from the HTML that are not required, then click Apply .
- Click Save to save the page.
- Click Publish Draft .
- Update the main header image on each page to an image from your organization.
For best results, this image should be 96 dpi and 1920 x 400.
For best results, these images should be 600 x 400 and 96 dpi.
Consider working with your Public Information Officer to refine this content to reflect your organizational needs.
Remove ArcGIS Hub Premium content
The Police Transparency solution comes with features that require ArcGIS Hub Premium if you are using ArcGIS Hub Basic, you will want to remove the features that require ArcGIS Hub Premium. Organizations using this solution with ArcGIS Hub Basic should perform the following steps to remove the ArcGIS Hub Premium content from their site.
To remove ArcGIS Hub premium content, complete the following steps:
- Browse to your app launcher and click Hub and click Police Transparency to begin editing the site.
- Scroll to the section titled Get Involved on the main site page.
- Click the delete button for the row card containing the section title, not just the section title.
- Click Save , then click Publish Draft .
- Repeat steps 1 through 3 for the Community Engagement , Workforce Diversity , Crime Stats , and Use of Forces pages in the site.
- Go to the Community Engagement page and scroll to the Scheduled Events section.
- Click the delete button for the row card containing the event calendar, not just the event calendar itself.
- Click Save , then click Publish Draft .
Modify custom use of force charts
Several charts on the Use of Force page of the Police Transparency solution make use of custom queries from solution layers that use preexisting values from domain lists. For your data to display properly in these charts, the values in your data must exactly match the values in the field domain list of the field in the feature layer. If your data contains different values, you must modify the custom JSON of the Hub charts to reflect your field values.
To modify the JSON of the custom use of force charts, complete the following steps:
- Sign in to your ArcGIS organization.
- Click your app launcher and select Hub .
- Click the Police Transparency site.
- On the Customize accordion, click the number of associated pages button.
- Click the Use of Force page.
- Find the chart labeled Serious Injury Use of Force Incidents and click the configure button (shaped like a gear).
- In the JSON Chart Definition section, find the section of the JSON that looks like the following:
"where": "forcelevel='Level 3- Serious Injury'"
2 Answers 2
There's no inherent way to filter out duplicates. You could write a client side script to scan the options and filter out the duplicates, but which of the duplicates should it take? Is it just the "Title" that's important? If it creates a link to the lookup item, is that reference important?
- Create a calculated column that combines Title + Some Other Field to create a unique, non-ambiguous value.
- Change the lookup to reference the new calculated column for its display, instead of the default Title or whatever it's set to
- When you pick from the dropdown now, you'll see your calculated value that makes it clear which item you're selecting.
Ok, if you really only want the unique values from a field in another list, you might consider creating a separate list that stores these values and have both lists reference this same list. In terms of relational design, that would be optimal.
However, in SharePoint, we know things aren't always optimal. You have to cut corners. So a similar approach would be to create the 3rd list with the unique values, and automatically add items to this list through a workflow whenever the original "lookup" list has an item added/updated. Then your 2nd list would reference this instead.
Again, you could also just create a script to scan the select options and remove duplicates by name. jquery could do this in a few lines of code, but this feels bad to me. Just my 2c.
MATH 1513 - COLLEGE ALGEBRA FOR BUSINESS, LIFE SCIENCES AND SOCIAL SCIENCES
Prerequisites: MATH 0403 or adequate math placement test score ENGL 0203, adequate placement score, or by meeting determined placement measures
The student will demonstrate an understanding of the general concepts of relation and function and specifically of polynomial, exponential, and logarithmic functions the ability to solve systems of equations by utilizing matrices and determinants and the ability to solve practical problems using algebra.
MATH 1613 - TRIGONOMETRY
Prerequisites: Pre or Corequisite: MATH 1513 or MATH 1533 or adequate math placement test score and ENGL 0203, adequate placement score, or by meeting determined placement measures
The student will evaluate trigonometric functions and their inverses, graph trigonometric functions, prove trigonometric identities, solve trigonometric equations, solve problems involving triangles and indirect measurement, use trigonometric forms of complex numbers, and identify and graph polar curves.
Here is an alternative way to do it with a constraint. In order to enforce this constraint you'll need a function that counts the number of occurrences of the field value. In your constraint, simply make sure this maximum is 1.
EDIT I can't remember right now -- and can't check it either -- whether the constraint check is done before the insert/update or after. I think after with the insert/update being rolled back on failure. If it turns out I'm wrong, the 2 above should be a 1.
Table function returns an int and uses the following select to derive it
This should be reasonably fast if your column as a (non-unique) index on it.
7 Answers 7
As crazy as it might sound the best practice nowadays is to not use built-in validation and instead use FluentValidation. Then the code will be very easy to read and super-maintainable since validation will be managed on separate class meaning less spaghetti code.
Pseudo-example of what you are trying to achieve.
The only way is to update your migration once you generate it, assuming you are using them, so that it enforces a unique constraint on the column.
The hard bit, though, is enforcing the constraint at the code level before you get to the database. For that you might need a repository that contains the complete list of unique values and makes sure that new entities don't violate that through a factory method.
There are a lot of requests for [Unique] in code first, but it looks like it isn't even making version 6: http://entityframework.codeplex.com/wikipage?title=Roadmap
You may do this checking in the code level before saving the data to the Database tables.
You can try using the Remote data annotation on your viewmodel to do an asynchronous validation to make the UI more responsive.
Make sure you have an IsExists action method in your Placecontroller which accepts a URL paramtere and check it againist your table and return true or false.
This msdn link has a sample program to show how to implement Remote attribute to do instant validation.
Also, If you are using a Stored procedure (For some reason), you can do an EXISTS check there before the INSERT query.