|
POST
|
The reason they are called centroids and not centre is that there are many definitions of centre. Centre of the polygon's envelope, centre of gravity, etc. With regular shapes such as your example, all the centroid definitions are pretty much the same and inside the polygon. There is a whole debate in geography about what constitutes the centre. I think geographers are still debating about what constitutes the centre of Scotland, many definitions place it in the sea. Please refer to esri documentation on centroid for examples on how it can end up outside of the polygon http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Centroid_Property/002m0000009p000000/
... View more
10-19-2011
06:14 AM
|
0
|
0
|
3878
|
|
POST
|
the area labelpoint is guaranteed to be inside the polygon. It may not be in the center (whatever that means to you) though.
... View more
10-19-2011
05:15 AM
|
0
|
0
|
3878
|
|
POST
|
You might also want to look at the IConversionNotation interface on the point. Depends on the coordinate system you start out in. James' link is a more generic way.
... View more
10-14-2011
09:40 AM
|
0
|
0
|
3878
|
|
POST
|
In VBA, ThisDocument is a shortcut to Application.Document. Both are equivalent.
... View more
10-14-2011
07:28 AM
|
0
|
0
|
1831
|
|
POST
|
In VBA you only use brackets in a method call when you expect a return. In the case of the ISelectionSet.Search, the cursor variable is passed in the method and returns populated. It is one of my peeves with ArcObjects, sometimes the method returns the value you want, other times you have to pass in a variable that gets populated by the function. Both methods are legitimate, I just wish esri picked one and stuck with it.
Dim pFCursor as IFeatureCursor
pFCursor = nothing
pSelectionSet.Search Nothing, False, pFCursor
... View more
10-14-2011
07:17 AM
|
0
|
0
|
1831
|
|
POST
|
in VBA you need to do 'set' with a pointer. A pointer is anything not a literal (a literal usually you can write down on a paper). set pFSelection = pMap.Layer(0) The part about declaring the variables is useful too since it avoids all kind of errors, you only need it if you put the option explicit at the top of the class (before any methods.) You should always use option explicit.
... View more
10-14-2011
05:19 AM
|
0
|
0
|
1831
|
|
POST
|
is this ArcGIS desktop or engine code or are you doing something with ArcGIS webserver? If this is all desktop or engine code than IIS shouldn't have anything to do with it. I often get object has disconnected from its client errors. Usually the problem is that the object was explicitly released using the marshal com releaser or the esri com releaser. Occasionally, I get problems threading, such as having an arcobjects event listener on a non-modal form. In almost all cases it boils down to a programming mistake that I made. My bet is the error happens for a particular code execution path that doesn't happen often.
... View more
10-12-2011
09:06 AM
|
0
|
0
|
1195
|
|
POST
|
Tthanks Duncan, you don't actually have to set the latlon properties, they all kind of just default. It is a work-around for my problem but the kicker is if you change back the Arcmap property to DD or if you change it to Degree Decimal minutes, the map is still DMS. If you change it to meters, the map changes to meters. Any Lat/Lon based system defaults to DMS. Based on this article, I think this was an pre-ArcGIS 10 thing. http://support.esri.com/en/knowledgebase/techarticles/detail/20801#comment-8682 Alex
... View more
10-11-2011
05:39 AM
|
0
|
0
|
718
|
|
POST
|
QueryFilterClass is the class that implements IQueryFilter. The use of the suffix class is correct and I believe preferable. The online help shows it such and the local dev help shows it in the header of the topic. I use it code also. Makes for strange looking code some times, a FeatureClass implements IFeature and a FeatureClassClass implements IFeatureClass. The code looks ok but it depends on the type of database your data is in. Shapefile, Personal geodatabase, file geodatabase, Oracle, SQLServer, they all have slightly different sql syntax. I would suggest you print out the searchStatement before the select is done and you paste it in the select by attribute form in the ArcMap GUI. If the query doesn't work in the GUI, it won't work in code. It could be as simple as a quote not closed or having to use square brackets around the field names. To get around syntax problems related to concatenation I prefer to use the string.format method, makes all the quotes and spaces needed immediately visible. instead of Dim str As String = "PLANNO = '" & AttPlanNumber & "' OR " & LOTNO = '" & AttLotNumber & "'" Dim str As String = string.format("PLANNO = '{0}' OR LOTNO = '{1}'", _
AttPlanNumber, AttLotNumber )
... View more
10-07-2011
12:46 PM
|
0
|
0
|
987
|
|
POST
|
Does any one know how to set the display units (or distance units) on the map programmatically to DMS (degree minutes seconds) or how to change the ArcMap options, dataview 'use these units instead of the frame's Display units (Degreee Minutes Seconds)? The IMap.DistanceUnits are esriUnits and have no DMS. I have not figured out how to access the ArcMap Options to override the units. Thanks
... View more
10-07-2011
05:02 AM
|
0
|
2
|
834
|
|
POST
|
The only way I see this working is if you write your own exe that starts ArcMap (by creating the application) and sets the values on the extension after arcmap finished starting.
... View more
10-04-2011
10:47 AM
|
0
|
0
|
2428
|
|
POST
|
I am not sure why the store is not working, the store should work. I don't see your variable declaration so I am not sure what is going on there. Without store I don't think this is going to work. When I work with annotation, I clone the annotation, make the changes and set the element back to the annotation property. Something like this dim annoClone as IClone
annoClone = directCast( pAnnoFeature.Annotation, IClone)
dim textElem as ITextElement = DirectCast(annoClone.Clone, ITextElement)
textElem.Text = "Hello"
pAnnoFeature.Annotation = textElem
dim feat as IFeature = DirectCast(pAnnoFeature, IFeature)
feat.Store Another thing is you don't have any edit operations started. This may or may not cause a problem but worth a try. If you still get the error on store, you can post the exact error to the thread.
... View more
09-30-2011
12:26 PM
|
0
|
0
|
719
|
|
POST
|
This is not really the right forum but I can answer. Your fields are not null they have an empty string. Empty strings and null are not the same thing from a database perspective. If your fields were truly null they would show <Null> in the field. try: [Field_name] = '' (two single quotes)
... View more
09-30-2011
11:54 AM
|
0
|
0
|
687
|
|
POST
|
Neil is right. New objects will work in the MSAccess workspace factory in some cases. For exampl,e you could create a new featurelayer, set its featureclass, name, symbols, etc. even save it as an lyr file, no problem. Try adding that layer to an ArcMap running in a different process, many many problems. If you are only interacting with a object in the local MSAccess memory space, new is the way to go. Technically if you are just calling some method with literal values, strings, integers, booleans, everything should be ok because you are not passing references to objects so the values get copied to the new process. If the object has to interact with objects in another memory space, such as ArcMap, ObjectFactory is the only way to go. You don't have the code posted but I suspect you create some object that interact with the pagelayout, if you create those objects in the MSAccess process, they have to go cross process to ArcMap to get the pagelayout, that is when bad things happen.
... View more
09-30-2011
06:43 AM
|
0
|
0
|
1861
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-02-2024 10:26 AM | |
| 1 | 07-05-2024 08:45 AM | |
| 1 | 10-05-2022 02:19 PM | |
| 6 | 03-27-2017 01:16 PM | |
| 1 | 05-05-2016 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-28-2025
07:37 AM
|