Modifica i layer vettoriali utilizzando la libreria GIS C#
Contents
[
Hide
]
Modifica i layer vettoriali
L’API Aspose.GIS ti consente di modificare i layer vettoriali come mostrato nello snippet di codice sottostante.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
using (var layer = Drivers.Kml.EditLayer(Path.Combine(workFolder, "edit_me_out.kml"))) | |
{ | |
// add | |
Feature featureToAdd = layer.ConstructFeature(); | |
featureToAdd.SetValue("string_field", "new_value"); | |
featureToAdd.Geometry = new Point(5, 5); | |
layer.Add(featureToAdd); | |
// update | |
Feature featureToReplace = layer.ConstructFeature(); | |
featureToReplace.SetValue("string_field", "updated_value"); | |
featureToReplace.Geometry = new Point(12, 12); | |
layer.ReplaceAt(1, featureToReplace); | |
// remove | |
layer.RemoveAt(0); | |
} |