Tag Info

Hot answers tagged

19

Vector data can have properties stored at two levels. File level or Layer level. For feature class (a type of vector data), file level information is stored in a geodatabase. This consists of properties like feature class geometry, attribute table, assigned subtypes and domains, a coordinate system, etc:. All these file level properties make up the actual ...


10

Which part of the script is actually taking up most of the time? There are about 5 other steps going on before you actually start deleting stuff. You might want to break your script down into bite-sized tests. For example, instead of creating a temporary connection file, listing a bunch of datasets, listing their contents, counting their records, and then ...


9

The trick to feedback is setting ISymbol.ROP to esriROPNotXOrPen and drawing the geometry twice, the first draw displays it, the second draw erases it. Be sure if you're using a multilayer symbol to set the ROP for each layer. public class MyTool : ESRI.ArcGIS.Desktop.AddIns.Tool { private ISymbol m_Symbol; private IPoint m_lastPoint; private ...


9

By "midpoint" I'm assuming you're asking about a centroid. For polygons, you'll want to cast it to an IArea object (see link for example), and then access the Centroid property. For points, you can simply get the X/Y property of the IPoint object. To get the feature, you can use various IFeatureClass methods such as GetFeature to access it using the ...


9

Features in the most general sense are analagous to records in computer science: In computer science, records (also called tuples, structs, or compound data) are among the simplest data structures. A record is a value that contains other values, typically in fixed number and sequence and typically indexed by names. The elements of records are ...


7

While there is no comfortable editor for label properties available yet, you can achieve the effect of label classes using "data defined labeling": This requires some data preparation, but the results should be just what you are looking for. Also of interest to you might be the new labeling tools by Sourcepole: move label tool … move text labels to a ...


7

Another approach to this would be to use the Spatial Join tool. Use the point as your input feature layer as above and the polygon layer as your identity features.Unlike SelectLayerByLocation, SpatialJoin does honor the extent environment. targetlayer = layername joinlayer=arcpy.PointGeometry(arcpy.Point(x, y)) fieldmappings = arcpy.FieldMappings() ...


7

Here's how I would do it: Make sure your data are in an appropriate projected coordinate system. Add a new Double field to the attribute table called Area. Run field calculator on this new field with the expression: !shape.area! and Python as the parser. Run Summary Statistics, performing COUNT on the Name field, and MAX on the Area field we added in step ...


7

I know this is old but I was looking for the same as I don't have ArcInfo for the FeatureVerticesToPoints tools. After using Search cursor solution above I went forward to simplify the code and found that using NumPy Arrays in the Data Access Module a simple and very quick script could be produced. I'm using this as a script tool. Note: The key is the ...


7

Few options. Some crazier :-) than others. The basic strategies are Cluster features Hide/move the top feature Send the click through the top feature ==> Turn on feature clustering strategy Implement your own clustering algorithm, so when a new item is added or modified, your algorithm re-runs and does a nested for-loop check and n*n(-1) checks to ...


7

You can unselect features with unselect and unselectAll methods of SelectFeature control: selectControl = new OpenLayers.Control.SelectFeature(vectorLayer); ... map.addControls([selectControl]); selectControl.activate(); // unselect any specific feature... selectControl.unselect(vectorLayer.features[0]); // ...or all features selectControl.unselectAll(); ...


7

The Feature Class to Feature Class tool is a Conversion tool. The idea is to convert a feature class in one format (e.g. shapefile) to another (e.g. geodatabase). It also allows the user to control the Field Map - i.e. which fields will be copied over. The Copy Features tool simply creates an exact copy of the input features. Note - this tool can also be ...


7

I recommend using the Select_analysis tool which will accept a where clause. arcpy.Select_analysis("C:/CGDP.shp", "C:/New.shp", ' "GDP_TOP10" = 1 ')


7

I doubt it has to do with the number of entries. I just added XY data for an Excel spreadsheet of 50000 rows by 17 columns of text of 200 characters and it exported to shapefile without a hiccup. From the error message page: 001337 : The maximum record length has been exceeded. The record length is the number of bytes used to define all the fields ...


6

What about simplifying geometries? http://www.bostongis.com/postgis_simplify.snippet http://stackoverflow.com/questions/1849928/how-to-intelligently-degrade-or-smooth-gis-data-simplifying-polygons Or maybe a combination of WFS, WFS with simplified features and WMS?


6

In the attribute table, compute a numeric field with the Python expression !shape.getpart(0).count! The triangles will all have values of 4 (three vertices plus a duplicate of the first one to close the polygon). The islands almost surely will have more than 4: select them based on this count and delete them, or (more safely) set the layer's definition ...


6

These terms specifically relate to the ESRI software and data schemas. A feature class is a set of common geographic features, for example roads, or parcels, or land use, as they are stored in a geodatabase or shapefile, or other storage format. Here is the help file on Feature Class Basics. A feature layer is the representation of a feature class after ...


6

Magnus, What are you intending to do with the OSM data once in a postgis table ? Depending on what you intend on doing with the data (Are you looking to do spatial analysis of highways ? Make a map of a complete city including restaurants and other POIs (points of interests) ? ), your osm2pgsql style files will be a little different. First, osm2pgsql's ...


6

You kind of have catch-22 or at minimum not detailed enough requirements. Specifically - do you want to remove the 1st feature as SOON as the user starts drawing a new feature? Or when they're done? Because you could end up blowing out your 1st feature and user cancels out of drawing 2nd feature and then you have nothing. You have 2 additional things ...


5

WFS caching might suit your needs. As far as I know, there are two open source solutions providing WFS caching: TileStache and GeoWebCache. In TileStache's home page, features section it is said "Generates vector tiles from OGR datasources in GeoJSON usable in Polymaps" GeoWebCache has some WFS caching capabilities since version 1.1.0 (the current one is ...


5

GeoServer provides a user setting to control the number of decimal places in the geometries which was put in there to speed up WFS serving. Also make sure that the server is compressing the output only if your client can efficiently uncompress it. Finally I've heard good things about tiny OWS in terms of speed.


5

Feature classes and object classes do have their ids, which are unique within a single geodatabase. This very often satisfies most scenarios similar to yours. If you cannot uniquely identify a layer based on its feature class, you can leverage layer extensions to store arbitrary data with the layer. A layer extension can be added to a layer via ...


5

Assuming you don't want to do this programmatically and with as little fuss as possible... At least at 9.3, ArcMap has an 'Add XY Coordinates' tool (under the Data Management -> Features toolbox). You can run this, which will add a field for the X & Y components of the point coordinate. You can open the attribute table of the layer and export (using ...


5

Hallo Merging or union as it is also often called can be more or less expensive depending on how the polygons are put together. If you start a one side and merge one polygon after another onto the resulting bigger and bigger polygon there will be a lot of work traversing the bigger resulting polygon for each added small polygon. One way to make this more ...


5

Try calling Store. pFeature.value(pFeature.Fields.FindField("Type")) = "update" pFeature.Store() Set pFeature = pEnumFeature.Next Are you in an edit session? Scroll down to best practices: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000010s000000.htm


5

you can use the export (multiple). In ArcCatalog... Just right click on the database and choose "export to shapefile (multiple)" If you do it at the database level you will see everything in the database in the tool listed (there is a remove button if there are a few you don't want). If you do it at the feature dataset level you see everything in ...


5

See my LIVE DEMO. Here is working code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title</title> <script src="http://openlayers.org/dev/OpenLayers.js"></script> <script type="text/javascript"> function init(){ options = { div: "map", zoom: 2, center: [0, 0], ...


5

You should use esriSpatialRelEnum.esriSpatialRelRelation instead and set the SpatialRelDescription property to pSFilter.SpatialRelDescription = "T***F****". This will only return the features that have the interiors intersecting.


4

The vertices are stored in two different properties of the ModifyFeature control - virtual vertices and vertices. You could check which group the vertex belonged to in the dragVertex event, and if it is in the virtual vertex array then ignore it. If you also set the virtualStyle of the control then these virtual vertices will be invisible. ...


4

Are you using a profiler? You are making multiple delete and store calls. These are expensive: Try: Reducing the number of times you call each function (store and delete); Merge all polygons, store only once (or a few times, after 'n' iterations); Delete only once (check ITable.DeleteSearchedRows(IFilter)); To delete only once, you can store a list of ...



Only top voted, non community-wiki answers of a minimum length are eligible