This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#* original post here http://blog.mikeasoft.com/2010/09/24/local-map-rendering-and-route-finding-with-libchamplain-spatialite-and-open-street-map/ | |
Importing OSM data into spatialite | |
spatialite_osm -o mydownloadeddata.osm -d myNewDB.sqlite -T roads -m | |
Generating a routing table | |
spatialite_network -d myNewDB.sqlite -T roads -g geometry -c cost -t node_to -f node_from -n name --oneway-fromto oneway_fromto --oneway-tofrom oneway_tofrom -o roads_net_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0"> | |
<NamedLayer> | |
<Name>Study Zones</Name> | |
<UserStyle> | |
<Name>Study Zones</Name> | |
<Title>Default zone style</Title> | |
<Abstract>Study Zone style</Abstract> | |
<FeatureTypeStyle> | |
<Name>Study Zones</Name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#download apache binaries: http://www.apachelounge.com/download/ | |
#http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.10-win32-VC11.zip | |
#unzip to a location you have permissions on your machine | |
#go in to folder to install apache and start it | |
cd c:\Apache24\conf | |
# edit file httpd.conf | |
# change all directory paths to cd c:\Apache24\ | |
#install apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv, arcpy | |
from arcpy import env | |
# set path using raw string to personal geodatabase | |
env.workspace = r"c:\users\mdiener\documents\mypersonalgeodatabase.gdb" | |
# create a python list of all datasets in personal geodatabase | |
datasetList = arcpy.ListDatasets('*','Feature') | |
# open a file for writing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyproj import Proj, transform | |
## my test coordinates, location is on the end of a peer on lake Wörthersee | |
## if the tranformation is wrong our point will be in the water | |
# these coorinates below I believe I can trust | |
# and are all TRUE for reference ( source KAGIS Atlas 17.10.2014) | |
# epsg proj coord | |
# epsg:31252 GK M31 70534.8 165013.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import django | |
from myapp import models | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings") | |
django.setup() | |
print models.MyModel.objects.get(pk=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import distutils | |
import subprocess | |
base_source_path = r"E:\WEBGIS\source\trunk\mysite" # svn source location | |
base_deploy_path = r"C:\inetpub\mysite" | |
source_dir3 = r"C:\Python27\Lib\site-packages\django_admin_bootstrapped\static\admin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Common Packages | |
# --------------- | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install software-properties-common libssl-dev openssl wget | |
## Install latest Python 3 | |
# ----------------------- | |
PY_VERSION=3.4.3 | |
PY_URL="https://www.python.org/ftp/python/$PY_VERSION/Python-$PY_VERSION.tgz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class AppQueryset(models.QuerySet): | |
pass | |
class AppManager(models.Manager): | |
queryset_class = AppQuerySet | |
def get_queryset(self): | |
return self.queryset_class(self.model) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from geojson import Feature | |
from django.contrib.gis.db.models.functions import Centroid, AsGeoJSON | |
from buildings.models import Space | |
from rest_framework.decorators import api_view | |
from rest_framework.response import Response | |
@api_view(['GET']) | |
def get_room_center(request, unique_id): |
OlderNewer