Try the following function in the field calculator:
split = f.split()
if len(split) == 0:
The above function will check if you have empty street names, it will return empty string, otherwise it will return the first name in title case existing in the street name column.
Based on your quesion and code I think you're after something like this:
import arcpy, os, itertools
arcpy.env.workspace = r"C:/test/Test.gdb"
# could be trouble if arcpy.env.overwriteOutput is False and the feature class already exists
arcpy.CreateFeatureclass_management("C:/test/Test.gdb", "linea", "POLYLINE")
# I ...
I suspect that ArcMap is interpreting your coordinates as Meters, rather than Degrees. If you Identify one of the points you may see this reflected as such
The reason for this is beause the World Topographic Basemap comes in with a Coordinate System WGS_1984_Web_Mercator_Auxiliary_Sphere with a linear unit of meters - Linear Unit: Meter (1.0)
When you ...
You can create an Attribute Table using the Build Raster Attribute Table tool which:
Create or update a table with information about the classes in your
raster datasets. This is used primarily with discrete data.
The Attribute Table will show the count of pixels for each one of your classes (colors).
In the attribute table, right click on the field you want to modify and select Field Calculator.
Set the parser to Python and tick the box for Show Codeblock.
Enter the following code:
result = ''.join([i for i in n if not i.isdigit()])
Then for the expression, type the following:
Yes, Python is good idea. So for a table structure like that:
below script will modify original shape(s) by one with area equal to defined percentage of original. So work on backup copy !!!.
polygons = "POLYGONS"
tolerance = 1
def splitMe (shp,leftSide):
E = shp.extent
low, high = E.XMin,E.XMax
pLow,pHigh = E.lowerLeft,E.upperLeft
Very simple solution possible in this case, because it's enough to find pair of vertices that will split hexagon in equal parts:
FeatureVerticesToPoints(in_features="HEXAGONS", out_feature_class="C:/SCRATCH/points.shp", point_location="ALL")
SelectLayerByAttribute(in_layer_or_view="points", selection_type="NEW_SELECTION", where_clause='mod( "FID",7) in (0,3)...
This seems like an obvious tool that ArcMap should have but it does not exists (to my knowledge) as a geoprocessing tool. Splitting polygons can be done in edit mode but not straight out of the box in a mass automated way.
Do you think you are the first person to have ever wanted to split a polygon in half...no! When you are using ArcMap and you think of ...
There are other uses of the .prj file, it doesn't 100% have to be associated with a shapefile, however that is certainly its origins.
Within ESRI packages, a .prj file could also be used to:
store custom coordinate sytem definitions, which could be imported and used as a Data frame definition
associated to a CAD file, such that when opening within ArcMap, a ...
The short answer is no, you can only symbolise on 3 attributes in ArcMap.
However, what you could do is separate your layer based on definition queries. That is, copy and paste the layer and set the definition queries for each.
For example, you could create a definition query for your valves to only show Status = Inuse.
Then, you'd only be symbolising on ...
The short answer is Yes, but creating and editing a TIN surface is beyond the scope of this forum, you need to be training yourself if you are asking such questions. As you have tagged this as an ArcMap question I suggest you head over to esri training and complete the Creating 3D Data using ArcGIS course.
EPSG 4326 is a coordinate system of latitude and longitude based on an ellipsoidal (squashed sphere) model of the earth. Its not really a projection.
EPSG 32637 (and any of the "UTM Zone" projections) is a projection of the round earth onto a flat surface, and has coordinates in metres. Its only accurate within the area of the zone, which is a ...
To create an address locator is simple in that you just need a street centerline shapefile of streets in Portland. This can be obtained from the Portland open data portal at this URL http://gis-pdx.opendata.arcgis.com/datasets/streets. Once you have obtained the street centerline shapefile you should use the Project Tool to project the shapefile in a proper ...
You should create two different label classes (changing labeling method in the layer's properties dialog) and based those two clases on SQL queries.
One class with the statement
Raised_Flat= 'RAISED' in wich the label field would be [Grave_Posi]
The other with Raised_Flat= 'Flat' and the label field [Lot_1]
You can look at this for a more detailed ...
There is a post by @KHibma on GeoNet that mentions how to release an Excel file lock from ArcCatalog
While this is about ArcCatalog, it might also work with ArcMap - maybe from the Catalog pane within the ArcMap application.
problem with ArcCatalog not releasing the file to use in Excel: If
you click the upper folder that the excel file lives in and refresh
list as a variable name might get you into trouble caio, try to make it a habit to prefix (myVar, pVar etc) or proper case (ProperCaseExample) your variable names otherwise you might end up overwriting a keyword. Python is lax in its protection of keywords and will not even issue a warning if you do overwrite one. Most python keywords are all lower case, ...
The Basemaps you have available to you in ArcMap are based on your current location. For example, if you're in the USA you'll have some different basemaps available compared to if you're in Mexico, India, or the UK.
Here are the available basemaps for those four examples from above:
There are likely other basemaps available (or not ...
I think that the constraints you are trying to use are mutually exclusive. You can not have a map that is fixed scale and also is cropped to the border of the townships because it appears that the townships are different sizes. You either need to have a fixed scale (in which case you can not have the map clipped to the extent of the township), or you need ...
You can edit attributes of multiple selected fields from the attribute table by using the Field Calculator.
Select all the features you would like to edit (eg all the Route features)
Right-click on the column header (Named Type in your screenshot) and click on "Calculate Field"
In the Field Calculator window enter the value you would like to ...
Try CAD to Geodatabase:
Reads a CAD dataset and creates feature classes of the drawing. The
feature classes are written to a geodatabase feature dataset.
Then export/convert the file geodatabase feature classes to shapefiles
You will have several options. You can used the built-in function of ArcGIS field by right-clicking, choose statistics and you can see the mean and other values of your selected list.
Here is a screenshot of the Field Calculator
You could also, right-click the field, choose field calculator which will provide you with the option to create a python script ...
Fortunately you are not dealing with polygons, so solution is simple. Extract vertices of your lines and clone them:
Copy("C:/SCRATCH/all_points.shp", "C:/SCRATCH/all_points_Copy.shp", "ShapeFile")
Run this field ...
I read your question as deciding which of the two given spatial reference systems apply to your CSV coordinates, fortunately this is a fairly easy decision.
As geographic or projected are your only two options look at the numbers given for the coordinates, if they're less than 365 x 90 (a circle in the X then half a circle in the Y from -90 to 90, which is ...
You could use a search cursor and list to check for and delete duplicates.
fc = r'path'
addr = 
with arcpy.da.UpdateCursor(fc, "ADRESSE") as cursor:
for row in cursor:
if not row in addr: