Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: These scripts seem to miss some trees #30

Open
ff6347 opened this issue May 16, 2024 · 0 comments
Open

Bug: These scripts seem to miss some trees #30

ff6347 opened this issue May 16, 2024 · 0 comments

Comments

@ff6347
Copy link
Collaborator

ff6347 commented May 16, 2024

These are the sql statements I used to find and update the missing trees after the scripts where run

select (SELECT count(1) from temp_trees) - (SELECT count(1) from trees) as missing;

--| missing |
--|---------|
--|   25383 |

SELECT gml_id from temp_trees
EXCEPT
SELECT gml_id from trees;

SELECT gml_id, count(1) from trees GROUP by gml_id;


CREATE TEMPORARY TABLE missing_trees AS
SELECT gml_id FROM temp_trees
EXCEPT
SELECT gml_id FROM trees;


SELECT * from missing_trees;

INSERT INTO trees (gml_id, standortnr, kennzeich, art_dtsch, art_bot, gattung_deutsch, gattung, strname, hausnr, pflanzjahr, standalter, stammumfg, baumhoehe, bezirk, eigentuemer, zusatz, kronedurch, "type", geom)
SELECT
	gml_id,
	standortnr,
	kennzeich,
	art_dtsch,
	art_bot,
	gattung_deutsch,
	gattung,
	strname,
	hausnr,
	pflanzjahr,
	standalter,
	stammumfg,
	baumhoehe,
	bezirk,
	eigentuemer,
	zusatz,
	kronedurch,
	"type",
	geom
FROM
	temp_trees
WHERE
	gml_id IN(
		SELECT
			gml_id FROM missing_trees);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant