Closed iboates closed 7 months ago
Sorry, I completely missed that this functionality already exists as publish_featurestore_sqlview
I get a 500 "Unknown type" from geoserver v2.24.1 using this function:
geo.publish_featurestore_sqlview(
name = "test-view",
store_name = "store",
sql = f"""
SELECT *
FROM capturelayer
""",
key_column = "cid",
geom_name = "geom",
geom_type = "Geometry",
srid = 3857,
workspace='test-workspace'
)
I can get it to return 201 if i set the name to a table that already exists 🤔
@kalkun I don't fully understand, what is the table that already exists? test-view
or capturelayer
?
Thanks for the quick reply 🙏 I resolved it eventually and im not sure exactly what did it but I still have a name that does not exists prior - so what I described wasnt the cause of it. In any case, I think it wasnt specific to this library.
Although it is not very clearly advertised, geoserver allows you to publish "SQL Views", which are actually just layers defined by a query. It seems that this should just be as easy and uploading the SQL embedded into the XML.
I can add this functionality. Would you prefer that I modify the code for
publish_featurestore
directly, or create a separate function, called something likepublish_sqlview
?