📘 API Reference Features¶
Georama Features¶
admin
¶
ColumnOgcApiFeaturesInline
¶
Bases: TabularInline
Source code in src/georama/features/admin.py
18 19 20 21 22 23 24 25 |
|
can_delete = False
class-attribute
instance-attribute
¶
extra = 0
class-attribute
instance-attribute
¶
formset = ColumnOgcApiFeaturesInlineFormset
class-attribute
instance-attribute
¶
model = ColumnOgcApiFeatures
class-attribute
instance-attribute
¶
has_add_permission(request, obj)
¶
Source code in src/georama/features/admin.py
24 25 |
|
ColumnOgcApiFeaturesInlineFormset
¶
Bases: BaseInlineFormSet
Source code in src/georama/features/admin.py
13 14 15 |
|
PublishedAsOgcApiFeaturesAdmin
¶
Bases: ModelAdmin
Source code in src/georama/features/admin.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
add_form_template = 'admin/features/publishedasvectorfeature/publish.html'
class-attribute
instance-attribute
¶
fieldsets = ((None, {'fields': ('title', 'name', 'public', 'column_permission', 'description', 'license', 'fees', 'access_constraints', 'dataset', 'max_items', 'default_items', 'on_exceed')}), ('Group permissions', {'fields': ('group_read_permission', 'group_create_permission', 'group_update_permission', 'group_delete_permission')}), ('User permissions', {'fields': ('user_read_permission', 'user_create_permission', 'user_update_permission', 'user_delete_permission')}))
class-attribute
instance-attribute
¶
form = PublishedAsOgcApiFeaturesForm
class-attribute
instance-attribute
¶
inlines = [ColumnOgcApiFeaturesInline]
class-attribute
instance-attribute
¶
list_display = ['name', 'title', 'public', 'delete_link', 'show_published']
class-attribute
instance-attribute
¶
list_editable = ['public']
class-attribute
instance-attribute
¶
readonly_fields = ['dataset']
class-attribute
instance-attribute
¶
add_view(request, form_url='', extra_context=None)
¶
Source code in src/georama/features/admin.py
87 88 89 90 91 92 93 94 95 96 97 |
|
delete_link(obj)
¶
Source code in src/georama/features/admin.py
99 100 101 102 103 104 |
|
save_model(request, obj, form, change)
¶
Source code in src/georama/features/admin.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
show_published(obj)
¶
Source code in src/georama/features/admin.py
106 107 108 109 110 111 |
|
_get_permissions(obj, permission_type)
¶
Source code in src/georama/features/admin.py
28 29 30 |
|
apps
¶
config_openapi
¶
config_openapi()
¶
Source code in src/georama/features/config_openapi.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
config_server
¶
ServerConfig
¶
Source code in src/georama/features/config_server.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
get()
¶
Source code in src/georama/features/config_server.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
features_config
¶
Config
¶
Source code in src/georama/features/features_config.py
4 5 6 7 8 9 10 11 |
|
forms
¶
PublishedAsOgcApiFeaturesForm
¶
Bases: ModelForm
Source code in src/georama/features/forms.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
group_create_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='Group create permission', is_stacked=False))
class-attribute
instance-attribute
¶
group_delete_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='Group delete permission', is_stacked=False))
class-attribute
instance-attribute
¶
group_read_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='Group read permission', is_stacked=False))
class-attribute
instance-attribute
¶
group_update_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='Group update permission', is_stacked=False))
class-attribute
instance-attribute
¶
user_create_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='User create permission', is_stacked=False))
class-attribute
instance-attribute
¶
user_delete_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='User delete permission', is_stacked=False))
class-attribute
instance-attribute
¶
user_read_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='User read permission', is_stacked=False))
class-attribute
instance-attribute
¶
user_update_permission = forms.ModelMultipleChoiceField(required=False, queryset=None, widget=widgets.FilteredSelectMultiple(verbose_name='User update permission', is_stacked=False))
class-attribute
instance-attribute
¶
Meta
¶
__init__(*args, **kwargs)
¶
Source code in src/georama/features/forms.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
get_first_match_partial_key(dictionary, partial_key)
staticmethod
¶
Source code in src/georama/features/forms.py
72 73 74 75 |
|
migrations
¶
0001_initial
¶
Migration
¶
Bases: Migration
Source code in src/georama/features/migrations/0001_initial.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
dependencies = [('data_integration', '0020_remove_vectordataset_extent_buffer')]
class-attribute
instance-attribute
¶
initial = True
class-attribute
instance-attribute
¶
operations = [migrations.CreateModel(name='PublishedAsOgcApiFeatures', fields=[('identifier', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('name', models.CharField(blank=True, default=None, max_length=1000, null=True)), ('public', models.BooleanField(default=False)), ('title', models.CharField(blank=True, default=None, max_length=1000, null=True)), ('description', models.TextField(blank=True, default=None, null=True)), ('license', models.TextField(default='\n This dataset is made available under the Open Database\n License: http://opendatacommons.org/licenses/odbl/1.0/.\n Any rights in individual contents of the database are licensed\n under the Database Contents\n License: http://opendatacommons.org/licenses/dbcl/1.0/\n ')), ('fees', models.TextField(default='No fees apply.')), ('access_constraints', models.TextField(default='No access constraints apply.')), ('column_permission', models.BooleanField(default=False)), ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='published_ogc_api_features', related_query_name='published_ogc_api_feature', to='data_integration.vectordataset'))], options={'abstract': False}), migrations.CreateModel(name='ColumnOgcApiFeatures', fields=[('identifier', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('name', models.CharField(blank=True, default=None, max_length=1000, null=True)), ('public', models.BooleanField(default=False)), ('title', models.CharField(max_length=1000)), ('published_definition', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='columns', related_query_name='column', to='features.publishedasogcapifeatures'))], options={'abstract': False}), migrations.CreateModel(name='PublishedAsWfs', fields=[('identifier', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('name', models.CharField(blank=True, default=None, max_length=1000, null=True)), ('public', models.BooleanField(default=False)), ('title', models.CharField(blank=True, default=None, max_length=1000, null=True)), ('description', models.TextField(blank=True, default=None, null=True)), ('license', models.TextField(default='\n This dataset is made available under the Open Database\n License: http://opendatacommons.org/licenses/odbl/1.0/.\n Any rights in individual contents of the database are licensed\n under the Database Contents\n License: http://opendatacommons.org/licenses/dbcl/1.0/\n ')), ('fees', models.TextField(default='No fees apply.')), ('access_constraints', models.TextField(default='No access constraints apply.')), ('column_permission', models.BooleanField(default=False)), ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='published_ogc_wfs', related_query_name='published_ogc_wfs', to='data_integration.vectordataset'))], options={'abstract': False}), migrations.CreateModel(name='ColumnWfs', fields=[('identifier', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('name', models.CharField(blank=True, default=None, max_length=1000, null=True)), ('public', models.BooleanField(default=False)), ('title', models.CharField(max_length=1000)), ('published_definition', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='columns', related_query_name='column', to='features.publishedaswfs'))], options={'abstract': False})]
class-attribute
instance-attribute
¶
0002_publishedasogcapifeatures_default_items_and_more
¶
Migration
¶
Bases: Migration
Source code in src/georama/features/migrations/0002_publishedasogcapifeatures_default_items_and_more.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
dependencies = [('features', '0001_initial')]
class-attribute
instance-attribute
¶
operations = [migrations.AddField(model_name='publishedasogcapifeatures', name='default_items', field=models.IntegerField(default=10, null=True)), migrations.AddField(model_name='publishedasogcapifeatures', name='max_items', field=models.IntegerField(default=500, null=True)), migrations.AddField(model_name='publishedasogcapifeatures', name='on_exceed', field=models.CharField(choices=[('ERROR', 'error'), ('THROTTLE', 'throttle')], default='ERROR', max_length=10, null=True)), migrations.AddField(model_name='publishedaswfs', name='default_items', field=models.IntegerField(default=10, null=True)), migrations.AddField(model_name='publishedaswfs', name='max_items', field=models.IntegerField(default=500, null=True)), migrations.AddField(model_name='publishedaswfs', name='on_exceed', field=models.CharField(choices=[('ERROR', 'error'), ('THROTTLE', 'throttle')], default='ERROR', max_length=10, null=True))]
class-attribute
instance-attribute
¶
models
¶
COLUMN_TYPE_VALUES = {'numeric': 'Numerical Type', 'string': 'Alphanumerical Type', 'boolean': 'Boolean Type', 'date': 'Date Type', 'datetime': 'Datetime Type'}
module-attribute
¶
Column
¶
Bases: PublishedAsRoleNameSystem
Source code in src/georama/features/models.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
create_permissions
property
¶
delete permission not relevant for specific property: create/delete property happens at the layer level
delete_permissions
property
¶
delete permission not relevant for specific property: create/delete property happens at the layer level
published_as_type = 'feature_column'
class-attribute
instance-attribute
¶
readable_identifier
property
¶
Using the publicatoin identifier at the end to make column visibly linked to their publication
title = models.CharField(max_length=1000)
class-attribute
instance-attribute
¶
Meta
¶
Source code in src/georama/features/models.py
102 103 |
|
abstract = True
class-attribute
instance-attribute
¶
__init_subclass__(**kwargs)
classmethod
¶
Source code in src/georama/features/models.py
73 74 75 76 |
|
get_published_definition()
¶
Source code in src/georama/features/models.py
88 89 |
|
save(*args, **kwargs)
¶
Source code in src/georama/features/models.py
91 92 93 94 95 |
|
ColumnOgcApiFeatures
¶
Bases: Column
Source code in src/georama/features/models.py
178 179 180 181 182 183 184 185 186 187 |
|
published_definition = models.ForeignKey(PublishedAsOgcApiFeatures, related_name='columns', related_query_name='column', on_delete=models.CASCADE)
class-attribute
instance-attribute
¶
get_published_definition()
¶
Source code in src/georama/features/models.py
186 187 |
|
ColumnWfs
¶
Bases: Column
Source code in src/georama/features/models.py
122 123 124 125 126 127 128 129 130 131 |
|
published_definition = models.ForeignKey(PublishedAsWfs, related_name='columns', related_query_name='column', on_delete=models.CASCADE)
class-attribute
instance-attribute
¶
get_published_definition()
¶
Source code in src/georama/features/models.py
130 131 |
|
PublishedAsOgcApiFeatures
¶
Bases: PublishedAsVectorFeature
Source code in src/georama/features/models.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
dataset = models.ForeignKey(VectorDataSet, null=True, related_name='published_ogc_api_features', related_query_name='published_ogc_api_feature', on_delete=models.CASCADE)
class-attribute
instance-attribute
¶
readable_identifier
property
¶
get_columns()
¶
Source code in src/georama/features/models.py
151 152 |
|
save(force_insert=False, force_update=False, using=None, update_fields=None)
¶
Source code in src/georama/features/models.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
PublishedAsVectorFeature
¶
Bases: PublishedAs
Source code in src/georama/features/models.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
ON_EXCEED_CHOICES = (('ERROR', 'error'), ('THROTTLE', 'throttle'))
class-attribute
instance-attribute
¶
all_permissions
property
¶
column_permission = models.BooleanField(default=False)
class-attribute
instance-attribute
¶
columns_permissions
property
¶
Returns all the possible permissions for columns of this VectorFeature
Doesn't check if column permissions are enabled on this VectorFeature publication
default_items = models.IntegerField(default=10, null=True)
class-attribute
instance-attribute
¶
max_items = models.IntegerField(default=500, null=True)
class-attribute
instance-attribute
¶
on_exceed = models.CharField(default='ERROR', choices=ON_EXCEED_CHOICES, max_length=10, null=True)
class-attribute
instance-attribute
¶
published_as_type = 'feature'
class-attribute
instance-attribute
¶
Meta
¶
Source code in src/georama/features/models.py
37 38 |
|
abstract = True
class-attribute
instance-attribute
¶
get_columns()
¶
Source code in src/georama/features/models.py
40 41 |
|
has_general_permission(user, app_name)
¶
include columns permissions in this check
Source code in src/georama/features/models.py
57 58 59 60 61 62 63 64 65 66 |
|
PublishedAsWfs
¶
Bases: PublishedAsVectorFeature
Source code in src/georama/features/models.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
dataset = models.ForeignKey(VectorDataSet, null=True, related_name='published_ogc_wfs', related_query_name='published_ogc_wfs', on_delete=models.CASCADE)
class-attribute
instance-attribute
¶
get_columns()
¶
Source code in src/georama/features/models.py
118 119 |
|
pygeoapi_providers
¶
postgres
¶
LOGGER = logging.getLogger(__name__)
module-attribute
¶
PostgresProvider
¶
Bases: BaseProvider
Generic provider for Postgresql based on psycopg2 using sync approach and server side using sync approach and server side cursor (using support class DatabaseCursor)
Source code in src/georama/features/pygeoapi_providers/postgres.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 |
|
_engine = get_engine(self.db_host, self.db_port, self.db_name, self.db_user, self._db_password, **self.db_options or {})
instance-attribute
¶
geom = provider_def.get('geom_field', 'geom')
instance-attribute
¶
id_field = provider_def['id_field']
instance-attribute
¶
storage_crs = provider_def.get('storage_crs', 'https://www.opengis.net/def/crs/OGC/0/CRS84')
instance-attribute
¶
table = provider_def['table']
instance-attribute
¶
table_model = get_table_model(self.table, self.id_field, self.db_search_path, self._engine)
instance-attribute
¶
__init__(provider_def)
¶
PostgreSQLProvider Class constructor
:param provider_def: provider definitions from yml pygeoapi-config. data,id_field, name set in parent class data contains the connection information for class DatabaseCursor
:returns: pygeoapi.provider.base.PostgreSQLProvider
Source code in src/georama/features/pygeoapi_providers/postgres.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
_feature_to_sqlalchemy(json_data, identifier=None)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
|
_get_bbox_filter(bbox)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
494 495 496 497 498 499 500 501 502 503 |
|
_get_cql_filters(filterq)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
467 468 469 470 471 472 473 474 475 476 477 478 |
|
_get_crs_transform(crs_transform_spec=None)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
555 556 557 558 559 560 561 562 563 |
|
_get_datetime_filter(datetime_)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
|
_get_order_by_clauses(sort_by, table_model)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
453 454 455 456 457 458 459 460 461 462 463 464 465 |
|
_get_property_filters(properties)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
480 481 482 483 484 485 486 487 488 489 490 491 492 |
|
_select_properties_clause(select_properties, skip_geometry)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
|
_sqlalchemy_to_feature(item, crs_transform_out=None)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
|
_store_db_parameters(parameters, options)
¶
Source code in src/georama/features/pygeoapi_providers/postgres.py
399 400 401 402 403 404 405 406 407 408 409 |
|
create(item)
¶
Create a new item
:param item: dict
of new item
:returns: identifier of created item
Source code in src/georama/features/pygeoapi_providers/postgres.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
delete(identifier)
¶
Deletes an existing item
:param identifier: item id
:returns: bool
of deletion result
Source code in src/georama/features/pygeoapi_providers/postgres.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
get(identifier, crs_transform_spec=None, **kwargs)
¶
Query the provider for a specific feature id e.g: /collections/hotosm_bdi_waterways/items/13990765
:param identifier: feature id
:param crs_transform_spec: CrsTransformSpec
instance, optional
:returns: GeoJSON FeatureCollection
Source code in src/georama/features/pygeoapi_providers/postgres.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
|
get_fields()
¶
Return fields (columns) from PostgreSQL table
:returns: dict of fields
Source code in src/georama/features/pygeoapi_providers/postgres.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
query(offset=0, limit=10, resulttype='results', bbox=[], datetime_=None, properties=[], sortby=[], select_properties=[], skip_geometry=False, q=None, filterq=None, crs_transform_spec=None, **kwargs)
¶
Query Postgis for all the content. e,g: http://localhost:5000/collections/hotosm_bdi_waterways/items? limit=1&resulttype=results
:param offset: starting record to return (default 0)
:param limit: number of records to return (default 10)
:param resulttype: return results or hit limit (default results)
:param bbox: bounding box [minx,miny,maxx,maxy]
:param datetime_: temporal (datestamp or extent)
:param properties: list of tuples (name, value)
:param sortby: list of dicts (property, order)
:param select_properties: list of property names
:param skip_geometry: bool of whether to skip geometry (default False)
:param q: full-text search term(s)
:param filterq: CQL query as text string
:param crs_transform_spec: CrsTransformSpec
instance, optional
:returns: GeoJSON FeatureCollection
Source code in src/georama/features/pygeoapi_providers/postgres.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|
update(identifier, item)
¶
Updates an existing item
:param identifier: feature id
:param item: dict
of partial or full item
:returns: bool
of update result
Source code in src/georama/features/pygeoapi_providers/postgres.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
_name_for_scalar_relationship(base, local_cls, referred_cls, constraint)
¶
Function used when automapping classes and relationships from database schema and fixes potential naming conflicts.
Source code in src/georama/features/pygeoapi_providers/postgres.py
630 631 632 633 634 635 636 637 638 639 640 641 642 643 |
|
get_engine(host, port, database, user, password, **connection_options)
cached
¶
Create SQL Alchemy engine.
Source code in src/georama/features/pygeoapi_providers/postgres.py
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 |
|
get_table_model(table_name, id_field, db_search_path, engine)
cached
¶
Reflect table.
Source code in src/georama/features/pygeoapi_providers/postgres.py
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
|
tests
¶
urls
¶
urlpatterns = [path('', views.landing_page, name='landing'), path('/conformance', views.conformance, name='conformance'), path('/openapi', views.openapi, name='openapi'), path('/collections', views.collections, name='collections'), path('/collections/<str:collection_id>', views.collections, name='collection-detail'), path('/collections/<str:collection_id>/schema', views.collection_schema, name='collection-schema'), path('/collections/<str:collection_id>/queryables', views.collection_queryables, name='collection-queryables'), path('/collections/<str:collection_id>/items', views.collection_items, name='collection-items'), path('/collections/<str:collection_id>/items/<str:item_id>', views.collection_item, name='collection-item'), path('/publish_as/oapif/<str:vector_dataset_id>', views.admin_publish_as_oapif, name='publish_as_oapif')]
module-attribute
¶
views
¶
api = None
module-attribute
¶
admin_publish_as_oapif(request, vector_dataset_id)
¶
helper function to hide actual connection in the database but make publishing straight forward.
Source code in src/georama/features/views.py
416 417 418 419 420 421 422 423 |
|
collection_item(request, collection_id, item_id)
¶
OGC API collections items endpoint
:request Django HTTP Request :param collection_id: collection identifier :param item_id: item identifier
:returns: Django HTTP response
Source code in src/georama/features/views.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
collection_items(request, collection_id)
¶
OGC API collections items endpoint
:request Django HTTP Request :param collection_id: collection identifier
:returns: Django HTTP response
Source code in src/georama/features/views.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
collection_queryables(request, collection_id=None)
¶
OGC API collections queryables endpoint
:request Django HTTP Request :param collection_id: collection identifier
:returns: Django HTTP Response
Source code in src/georama/features/views.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
collection_schema(request, collection_id=None)
¶
OGC API collections schema endpoint
:request Django HTTP Request :param collection_id: collection identifier
:returns: Django HTTP Response
Source code in src/georama/features/views.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
collections(request, collection_id=None)
¶
OGC API collections endpoint
:request Django HTTP Request :param collection_id: collection identifier
:returns: Django HTTP Response
Source code in src/georama/features/views.py
56 57 58 59 60 61 62 63 64 65 66 67 |
|
conformance(request)
¶
OGC API conformance endpoint
:request Django HTTP Request
:returns: Django HTTP Response
Source code in src/georama/features/views.py
45 46 47 48 49 50 51 52 53 |
|
create_ogr_provider(published_as, editable, features_properties)
¶
Source code in src/georama/features/views.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
|
create_postgres_provider(published_as, editable, features_properties)
¶
Source code in src/georama/features/views.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
create_resource(published_as, request)
¶
Source code in src/georama/features/views.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
|
execute_from_django(api_function, request, *args, skip_valid_check=False)
¶
Source code in src/georama/features/views.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
|
handle_crs_setting(crs)
¶
Source code in src/georama/features/views.py
268 269 270 271 272 |
|
handle_runtime_config(request)
¶
Source code in src/georama/features/views.py
230 231 232 233 234 235 236 237 238 |
|
landing_page(request)
¶
OGC API landing page endpoint
:request Django HTTP Request
:returns: Django HTTP Response
Source code in src/georama/features/views.py
23 24 25 26 27 28 29 30 31 |
|
openapi(request)
¶
OpenAPI endpoint
:request Django HTTP Request
:returns: Django HTTP Response
Source code in src/georama/features/views.py
34 35 36 37 38 39 40 41 42 |
|