josephramsay / lds_replicate

Replication scripts for LDS (LINZ Data Service).
http://data.linz.govt.nz/
2 stars 1 forks source link

Problem with Delete/Update on layers without PK #6

Open josephramsay opened 11 years ago

josephramsay commented 11 years ago

Because the primary key field is translated to a FID, when a layer doesn't have a primary key eg topo or hydro, this process fails.

palmerj commented 11 years ago

Layers without primary keys should not be allowed to replicate i.e not WFS change-set service

These type of layers should only be in 'full' replicate mode. i.e truncate layer data, replicate all data from LDS again using normal WFS for each update.

josephramsay commented 11 years ago

The solution I've come up with (see last commit) is to attempt a feature match based on all non null column values when a PK isn't available. Its worked for a couple of test cases. Not particularly fast though...

palmerj commented 11 years ago

Not reliable and I'm sure you will get duplicates in this case. Just keep it simple: When there is no primary key don't attempt change-set processing.


From: josephramsay [mailto:notifications@github.com] Sent: Friday, 11 January 2013 9:14 a.m. To: josephramsay/LDS Cc: Jeremy Palmer Subject: Re: [LDS] Problem with Delete/Update on layers without PK (#6)

The solution I've come up with (see last commit) is to attempt a feature match based on all non null column values when a PK isn't available. Its worked for a couple of test cases. Not particularly fast though...

Reply to this email directly or view it on GitHubhttps://github.com/josephramsay/LDS/issues/6#issuecomment-12116327.


This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.

josephramsay commented 11 years ago

Bypass (uses driverCopy instead of featureCopy) implemented for incremental requests to layers without a primary key. Tested on 181 (multiple duplicate non spatial fields). NB Primary Key identification still depends on init script {set pkey=id unless layer in [topo,hydro]}