Copy/Paste Features To New Layer?

14 views
Skip to first unread message

John Laurence Poole

unread,
Apr 7, 2018, 9:00:55 AM4/7/18
to openjump-users

I'm working with tax assessor parcels.  The layer "taxlot" consists of shapefiles that I imported from our county's GIS department.  Each shape has many features including acres, address_range, zoning codes. & etc.

What I want to accomplish is creating a data subset of selected properties (slated to be rezoned) and copy the entities with all their features to a new layer using OpenJump's graphical interface and then save the data subset in PostGIS so I can perform some analysis on the subset of data.

Here's what I am finding happens:

Layer Testpaste is set to visible, selectable and editable.
Layer taxlot set to visible and selectable, but not editable.  taxlot is colored pink.
Layer Testpaste is arranged higher (in z order) than layer taxlot. Testpaste is color green.

Layer Testpaste is selected as the current layer.

In OpenJump's graphical child window where the parcels are displayed, I select a parcel.  I click Control-C, Control-V and the parcel changes from pink to green.  The color change evidences that I have copied the shape form taxlot to Testpaste.  I then make Layer taxlot invisible.  I select anew the newly pasted object in Testpaste and then view its features.  The only feature showing is the GEOMETRY, all the other features such as zoning codes did not copy over.

When I was experimenting earlier, I selected several parcels, pasted them onto a new higher layer, and then successfully saved the parcel with all their features into PostGIS using the command File->Save_Dataset_As or File->Save_Dataset_As(testing).  I do not recall all the settings for the layers nor which radio button I selected in the File->Save Data set as... But when I tried again on a larger scale, I found in Postgres that only the GEOMETRY column was saved to the database.

1.  What is the procedure to copy an object from one layer to another with all the features?
2.  What is the recommended procedure or menu selections to store all the features of the newly pasted object to PostGIS?
3.  If I alter a table created by the File->Save Data set as...  in PostGis, either simultaneously, or in a session when OpenJump is not connected, will the alterations such as added columns appear as features in OpenJump?  Also, if I perform the alterations in Postgres, e.g. ALTER TABLE TESTPASTE add COLUMN DEMOLITION_DATE DATE, what is the command or sequence of steps to refresh the object in OpenJump?  Do I need to disconnect and then reconnect to Postgres?




John Laurence Poole

unread,
Apr 7, 2018, 9:14:18 AM4/7/18
to openjump-users
Ahah.    Edit->Replicate Selected Features accomplishes the copy/paste of all features.

John Laurence Poole

unread,
Apr 7, 2018, 9:54:50 AM4/7/18
to openjump-users
I studied the code at src\org\openjump\core\ui\plugin\edit\ReplicateSelectedItemsPlugIn.java

For someone trying to accomplish what I was doing, I share here what I found works.

First of all, having an understanding about the architecture of Layers and the objects within is important.  I believe that each layer has a schema, so you cannot go copying objects from one layer to another as one might in Adobe Illustrator or other graphics programs where layer is simply a "z" order attribute.  For purposes of the replication tool, the schemas between the layer copied from and copied to need to be identical.  If they are not, you'll get the incompatible schemas error window which essentially prevents you from completing a replication.

Here's what I found works:

select an item you want to replicate and allow it to be "replicated" to a new layer, one I'll reference as "MU3".  Doing this will cause the new layer, "MU3" to inherit the schema of the source layer, e.g. "taxlots".  Then, you can go back to the source layer taxlots and select multiple items and using the replicate plug-in specify that instead of going to yet-another "new" layer, go to "MU3".  Since the schemas of taxlots and MU3 match, the replication will progress.

Reply all
Reply to author
Forward
0 new messages