Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: Trouble with shapefile.dissolve

$
0
0
I'm using just a very basic test rig using Excel VBA and one group is always missed out, I randomly tagged a string field with "One", "Two" and "Three" against shapes, the "dissolve" returned a file with shapes for "One" and "Two", I changed some of the tags to "Four" and got a file back with "One", "Three" and "Four" (with just a hole where "Two" should be).

I declared OUTsf both with "New" and without - the code disturbingly worked either way but with the same result!

The input file is a filename via an Excel cell and the merge field is from a combo box (but hard coding gives the same wrong result) I used a temporary result for the field number as in the past I've had the odd problem with feeding cell values to parameters. The code is about as basic as it can get! Since it's almost working I'm pretty sure the parameters are correct. Has anyone any ideas?

Private Sub cbFieldList_Change()
Dim INsf As New mapwingis.shapefile
Dim OUTsf As New mapwingis.shapefile
Dim SelectedField As Integer

INsf.Open (Worksheets("Configuration").Range("ACTIVEFILE"))
SelectedField = cbFieldList.ListIndex

Set OUTsf = INsf.Dissolve(SelectedField, False)
OUTsf.SaveAs "c:\temp.shp"
End Sub

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>