Disclaimer: The idea came from this blog . So, what's the difference? I'm using Windows. cURL should be installed already. If you have lots of tables in your database that you wanted to publish in GeoServer, you can use this method. Just prepare a list of tables (separated by new line) you want to publish in a text file format. Before proceeding in publishing layers, you need to setup a workspace and store in your GeoServer first. Although this can be done using cURL and REST API, but it is more convenient in that way. After a minute.... :D :D Create ".bat" file Use the code below but (of course) change the necessary inputs for /f %%a in ( <list of tables you want to publish> .txt) do curl -v -u <username> : <password> -XPOST -H "Content-type: text/xml" -d "<featureType><name>%%a</name></featureType>" http://localhost:8080/geoserver/rest/workspaces/ <name of workspace> /datastores/...
The code below automatically loads the shapefile found in a certain directory into a PostgreSQL database within a given interval(in this example 2 minutes). Downside (in which I'm trying to figure out): What if the filename of the shapefile changes? Anyway, this suits of what I need right now. __author__ = 'Matt' import os from django.db import connection from django.contrib.gis.utils import LayerMapping from .models import FloodHazard import datetime import time import logging from apscheduler.scheduler import Scheduler logging.basicConfig() # Start the scheduler sched = Scheduler() sched.daemonic = False sched.start() #ogrinspect evidensapp/data/flood_hazard/FloodHazard.shp FloodHazard --srid=32651 --mapping --multi # Auto-generated `LayerMapping` dictionary for FloodHazard model floodhazard_mapping = { 'hazard': 'Hazard', 'date_field': 'Date_', 'geom': 'MULTIPOLYGON' } bound_shape = os.path.abspath(os....
So, you decided to enlarge or make your blog smaller. And then this happens: The image's size overlaps to the blog(main-wrapper) width, you can fix it by editing the post but what if your other posts have the same problem. Changing the image size will be tiring by doing it individually. So to solve this.We need a simple CSS code: Here's the solution:
Comments
Post a Comment
Feel free to ask, suggest and comment regarding this post/blog. You can also contact me through e-mail, just always use the contact page. Thank you for visiting this blog.