Introduction to the OpenGeo Suite

Editing Features

Two other options enabled when we logged in to GeoExplorer were the layer editing features. These powerful tools allow authenticated users to Create, Edit, and Delete features served through GeoServer using the web browser.

Feature editing tools

Button Name Description
../_images/gx_icon_createfeature.png Create New Feature Initiates the workflow to create a new feature in the selected layer.
../_images/gx_icon_editfeature.png Edit Existing Feature Initiates the workflow to edit and/or delete an existing feature in the selected layer.

Creating new features

The intention of the smallworld layer is to capture a list of places. Let’s add some more!

Use the following workflow to create points for several other cities you’ve been to.

  1. You should be logged into GeoExplorer, and your smallworld layer should be loaded, visible and selected.

    ../_images/gx_create_selected.png
  2. Click the Create Feature button to make it active.

    ../_images/gx_create_createfeaturebutton.png
  3. Navigate to a memorable destination.

    Note

    Don’t forget that you can zoom and pan with any tool active by using the Shift and Control keys, respectively.

  4. Once you’ve found your destination, click the location on the map. GeoExplorer places a blue marker on the map at your click point, and opens a small dialog box containing a table of attributes.

    ../_images/gx_create_newmarker.png
  5. Fill in the name of the Place, Year visited, and a short Comment (e.g. the purpose of your visit). If you want, while you’re in edit mode, you can adjust your point on the map by dragging the temporary marker elsewhere.

    ../_images/gx_create_newattributes.png
  6. Once you’re satisfied, click Save.

  7. Repeat this process for a few more places. Hit some other countries, continents, and hemispheres. Make places up.

Note

You’ve added spatial records to a PostGIS database table through a browser. Awesome!

Editing existing features

Let’s now edit an existing feature.

  1. You should be logged into GeoExplorer, and your smallworld layer should be loaded, visible and selected. You should be zoomed in to a point (at zoom-level 10 or thereabouts).

    ../_images/gx_edit_navigate.png
  2. If it isn’t already, click the Edit Feature button to make it active.

    ../_images/gx_edit_editfeature.png
  3. Click on the feature you wish to edit.

  4. A familiar dialog will pop up listing the attributes of the selected feature and highlighting its geometry.

    ../_images/gx_edit_popup.png
  5. Click the Edit button (at the bottom left of the dialog). The pop-up will change to a mode where the field values can be edited.

  6. Change the year, or any other value, and move the point marker closer to the city center.

    ../_images/gx_edit_makeedits.png
  7. Click Save.

Note

You’ve gone and edited the attributes and geometries of features in a spatial database over the web. Nicely done!

Deleting existing features

Again for the sake of example, let’s assume that at least one of your destinations was bogus and delete it.

../_images/gx_delete_navigate.png
  1. You should be logged into GeoExplorer, and your smallworld layer should be loaded, visible and selected. You should be zoomed into a feature at zoom-level 10 or thereabouts.

  2. Navigate to a point in smallworld that you’ve never been to or are trying to forget about.

  3. If it isn’t already, click the Edit Feature button to make it active.

  4. Click on the point you wish to delete. The feature edit dialog opens.

  5. Next to the Edit button you’ll notice a Delete button that does exactly what its name implies.

  6. Click the Delete button. This opens a prompt asking for confirmation that you do want to delete the feature. Click Yes.

    ../_images/gx_delete_confirmation.png

    Delete confirmation

  7. Your feature will be deleted, both from the map and the database.

Continue Reading

Previous: Styling Layers

Next: Saving map layouts

This Page

About Boundless

Boundless provides commercial open source software for internet mapping and geospatial application development. We are dedicated to the growth and support of open source software.

License

This work is licensed under a Creative Commons Non Commercial-Attribution-Share Alike 3.0 United States License. Feel free to use this material, but we ask that you please retain the Boundless branding, logos and style.

Creative Commons License