Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions base_geoengine/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,10 @@
"web.assets_backend": [
"base_geoengine/static/src/js/**/*",
"base_geoengine/static/src/css/style.css",
"web/static/src/libs/fontawesome/css/font-awesome.css",
("include", "web._assets_helpers"),
"web/static/src/scss/pre_variables.scss",
"web/static/lib/bootstrap/scss/_variables.scss",
("include", "web._assets_bootstrap"),
],
"base_geoengine.assets_jsLibs_geoengine": [
"/base_geoengine/static/lib/ol-10.5.0/ol.js",
"/base_geoengine/static/lib/chromajs-3.1.2/chroma.js",
"/base_geoengine/static/lib/geostats-2.1.0/geostats.js",
"/base_geoengine/static/lib/geostats-2.1.0/geostats.css",
"base_geoengine/static/lib/geostats-2.1.0/geostats.css",
],
# Note: Third-party libraries (ol.js, chroma.js, geostats.js) are loaded
# dynamically via loadJS() in geoengine_libs.esm.js to avoid bundler issues
},
"external_dependencies": {"python": ["shapely", "geojson"]},
"installable": True,
Expand Down
6 changes: 5 additions & 1 deletion base_geoengine/geo_convertion_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def value_to_shape(value, use_wkb=False):
elif use_wkb:
return wkb.loads(value, hex=True)
else:
return wkt.loads(value)
try:
int(value, 16)
return wkb.loads(value, hex=True)
except Exception:
return wkt.loads(value)
elif hasattr(value, "wkt"):
if isinstance(value, BaseGeometry):
return value
Expand Down
4 changes: 3 additions & 1 deletion base_geoengine/models/geo_raster_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class GeoRasterLayer(models.Model):
params = fields.Char(help="Dictiorary of values for dimensions as JSON")

# wms options
params_wms = fields.Char(help="Need to provide at least a LAYERS param")
params_wms = fields.Char(
"Params WMS", help="Need to provide at least a LAYERS param"
)
server_type = fields.Char(
help="The type of the remote WMS server: mapserver, \
geoserver, carmentaserver, or qgis",
Expand Down
19 changes: 17 additions & 2 deletions base_geoengine/models/geo_vector_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ class GeoVectorLayer(models.Model):
ondelete="cascade",
domain=[("ttype", "ilike", "geo_")],
)
attribute_field_id = fields.Many2one(
"ir.model.fields", "Attribute field", domain=[("ttype", "in", SUPPORTED_ATT)]

attribute_field_id_domain = fields.Binary(
compute="_compute_attribute_field_id_domain", readonly=True, store=False
)
attribute_field_id = fields.Many2one("ir.model.fields", "Attribute field")

model_id = fields.Many2one(
"ir.model",
"Model to use",
Expand Down Expand Up @@ -155,3 +158,15 @@ def _compute_model_id(self):
rec.model_id = ""
else:
rec.model_id = ""

@api.depends("geo_field_id")
def _compute_attribute_field_id_domain(self):
for rec in self:
rec.attribute_field_id_domain = (
[
("ttype", "in", SUPPORTED_ATT),
("model", "=", rec.geo_field_id.model_id.model),
]
if rec.geo_field_id
else [("ttype", "in", SUPPORTED_ATT)]
)
72 changes: 0 additions & 72 deletions base_geoengine/static/lib/chromajs-3.1.2/chroma.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
chroma.js - JavaScript library for color conversions

Copyright (c) 2011-2015, Gregor Aisch
Copyright (c) 2011-2025, Gregor Aisch
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -26,3 +26,29 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-------------------------------------------------------

chroma.js includes colors from colorbrewer2.org, which are released under
the following license:

Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
and The Pennsylvania State University.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the License.

------------------------------------------------------

Named colors are taken from X11 Color Names.
http://www.w3.org/TR/css3-color/#svg-color

@preserve
72 changes: 72 additions & 0 deletions base_geoengine/static/lib/chromajs-3.2.0/chroma.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion base_geoengine/static/lib/geostats-2.1.0/geostats.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
width: 20px;
}

.geostats-legend-counter {
.geostats-legend-counter {
font-size: 0.8em;
color:#666;
font-style: italic;
Expand Down
Loading