Skip to content

Bug: These scripts seem to miss some trees #30

@ff6347

Description

@ff6347

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions