Skip to content

Commit 4b04c2f

Browse files
committed
maps labben
1 parent e370df0 commit 4b04c2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+854878
-0
lines changed

maps_labb/README.md

Whitespace-only changes.

maps_labb/imap/#nodeCount.py#

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Parser example
2+
# Usage python parser_ex.py
3+
4+
import sys
5+
from datetime import datetime
6+
7+
from mapvis.osm_parser import get_default_parser
8+
9+
# The first argument after the python module on the commandline
10+
#filename = sys.argv[0]
11+
12+
# Parse the supplied OSM file
13+
start = datetime.now()
14+
15+
parser = get_default_parser('Ourmap.osm')
16+
17+
nodes = 0
18+
for node in parser.iter_nodes():
19+
nodes += 1
20+
21+
end = datetime.now()
22+
23+
print("The data contains", nodes, "nodes")
24+
print("Parsing the date took", (end - start).total_seconds(), "seconds")

maps_labb/imap/Ourmap (backupcopy).osm

Lines changed: 426828 additions & 0 deletions
Large diffs are not rendered by default.

maps_labb/imap/Ourmap.osm

Lines changed: 426828 additions & 0 deletions
Large diffs are not rendered by default.
510 Bytes
Binary file not shown.
1019 Bytes
Binary file not shown.
511 Bytes
Binary file not shown.
576 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

maps_labb/imap/bobbn_lace/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.

maps_labb/imap/bobbn_lace/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

maps_labb/imap/bobbn_lace/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BobbnLaceConfig(AppConfig):
5+
name = 'bobbn_lace'

maps_labb/imap/bobbn_lace/migrations/__init__.py

Whitespace-only changes.

maps_labb/imap/bobbn_lace/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.

maps_labb/imap/bobbn_lace/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

maps_labb/imap/bobbn_lace/views.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.
4+
from django.shortcuts import render_to_response
5+
from django.template import Template, Context
6+
7+
class Member:
8+
def __init__(self, name, age):
9+
self.name = name
10+
self.age = age
11+
12+
def memb_reg(request):
13+
members = dict()
14+
members[2] = Member("Kurt", 64)
15+
members[5] = Member("Anne", 39)
16+
members[3] = Member("Berit", 15)
17+
members[8] = Member("Julius_Caesar", 2113)
18+
19+
c = Context({
20+
'NUMBER_OF_MEMBERS': len(members),
21+
'MEMBER_INFO': members, # Important, note the last ","!
22+
})
23+
24+
return render_to_response('bobbn_lace/memb_reg.html', c)

maps_labb/imap/bobbn_lace/views.py~

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.
4+
from django.shortcuts import render_to_response
5+
from django.template import Template, Context
6+
7+
class Member:
8+
def __init__(self, name, age):
9+
self.name = name
10+
self.age = age
11+
12+
def memb_reg(request):
13+
members = dict()
14+
members[2] = Member("Kurt", 64)
15+
members[5] = Member("Anne", 39)
16+
members[3] = Member("Berit", 15)
17+
members[8] = Member("Julius_Caesar", 2113)
18+
19+
c = Context({
20+
'NUMBER_OF_MEMBERS': len(members),
21+
'MEMBER_INFO': members, # Important, note the last ","!
22+
})
23+
24+
return render_to_response('bobbn_lace/memb_reg.html', c)

maps_labb/imap/db.sqlite3

3 KB
Binary file not shown.

maps_labb/imap/edgeCount.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Parser example
2+
# Usage python parser_ex.py
3+
4+
import sys
5+
from datetime import datetime
6+
7+
from mapvis.osm_parser import get_default_parser
8+
9+
# The first argument after the python module on the commandline
10+
#filename = sys.argv[0]
11+
12+
# Parse the supplied OSM file
13+
start = datetime.now()
14+
15+
parser = get_default_parser('Ourmap.osm')
16+
17+
edges = 0
18+
for way in parser.iter_ways():
19+
edges += 1
20+
21+
end = datetime.now()
22+
23+
print("The data contains", edges, "ways")
24+
print("Parsing the date took", (end - start).total_seconds(), "seconds")

maps_labb/imap/edgeCount.py~

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Parser example
2+
# Usage python parser_ex.py
3+
4+
import sys
5+
from datetime import datetime
6+
7+
from mapvis.osm_parser import get_default_parser
8+
9+
# The first argument after the python module on the commandline
10+
#filename = sys.argv[0]
11+
12+
# Parse the supplied OSM file
13+
start = datetime.now()
14+
15+
parser = get_default_parser('Ourmap.osm')
16+
17+
nodes = 0
18+
for way in parser.iter_ways():
19+
way += 1
20+
21+
end = datetime.now()
22+
23+
print("The data contains", way, "ways")
24+
print("Parsing the date took", (end - start).total_seconds(), "seconds")

maps_labb/imap/extractor.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from mapvis.osm_parser import get_default_parser
2+
from mapvis.store import NodeSet
3+
4+
def extract_osm_nodes(f_name):
5+
# Parse the supplied OSM file
6+
print("Loading data...")
7+
parser = get_default_parser(f_name)
8+
node_set = NodeSet()
9+
10+
for node in parser.iter_nodes():
11+
node_set.add(node['id'], node['lat'], node['lon'])
12+
13+
return node_set
14+
15+
nodes = extract_osm_nodes('Ourmap.osm')
16+
nodes.print_node_set()

maps_labb/imap/extractor.py~

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from mapvis.osm_parser import get_default_parser
2+
from mapvis.store import NodeSet
3+
4+
def extract_osm_nodes(f_name):
5+
# Parse the supplied OSM file
6+
print("Loading data...")
7+
parser = get_default_parser(f_name)
8+
node_set = NodeSet()
9+
10+
for node in parser.iter_nodes():
11+
node_set.add(node['id'], node['lat'], node['lon'])
12+
13+
return node_set
14+
15+
nodes = extract_osm_nodes('Ourmap.osm')
16+
nodes.print_node_set()

maps_labb/imap/imap/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
535 Bytes
Binary file not shown.

maps_labb/imap/imap/settings.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
"""
2+
Django settings for imap project.
3+
4+
Generated by 'django-admin startproject' using Django 1.10.6.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/1.10/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/1.10/ref/settings/
11+
"""
12+
13+
import os
14+
15+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'xk9l6thh+lg*y#d883sbfpc=yfp6wp0*m*j_6esp!1z%!!f6$u'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = ['127.0.0.1', '0.0.0.0']
29+
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'django.contrib.admin',
35+
'django.contrib.auth',
36+
'django.contrib.contenttypes',
37+
'django.contrib.sessions',
38+
'django.contrib.messages',
39+
'django.contrib.staticfiles',
40+
]
41+
42+
MIDDLEWARE = [
43+
'django.middleware.security.SecurityMiddleware',
44+
'django.contrib.sessions.middleware.SessionMiddleware',
45+
'django.middleware.common.CommonMiddleware',
46+
'django.middleware.csrf.CsrfViewMiddleware',
47+
'django.contrib.auth.middleware.AuthenticationMiddleware',
48+
'django.contrib.messages.middleware.MessageMiddleware',
49+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
50+
]
51+
52+
ROOT_URLCONF = 'imap.urls'
53+
54+
TEMPLATES = [
55+
{
56+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
57+
'DIRS': [os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'templates')).replace( '\\', '/' )],
58+
'APP_DIRS': True,
59+
'OPTIONS': {
60+
'context_processors': [
61+
'django.template.context_processors.debug',
62+
'django.template.context_processors.request',
63+
'django.contrib.auth.context_processors.auth',
64+
'django.contrib.messages.context_processors.messages',
65+
],
66+
},
67+
},
68+
]
69+
70+
WSGI_APPLICATION = 'imap.wsgi.application'
71+
72+
73+
# Database
74+
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
75+
76+
DATABASES = {
77+
'default': {
78+
'ENGINE': 'django.db.backends.sqlite3',
79+
'NAME': os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'lmap.sqlite3').replace( '\\', '/' )),
80+
}
81+
}
82+
83+
84+
# Password validation
85+
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
86+
87+
AUTH_PASSWORD_VALIDATORS = [
88+
{
89+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90+
},
91+
{
92+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93+
},
94+
{
95+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96+
},
97+
{
98+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99+
},
100+
]
101+
102+
103+
# Internationalization
104+
# https://docs.djangoproject.com/en/1.10/topics/i18n/
105+
106+
LANGUAGE_CODE = 'en-us'
107+
108+
TIME_ZONE = 'Europe/Stockholm'
109+
110+
USE_I18N = True
111+
112+
USE_L10N = True
113+
114+
USE_TZ = True
115+
116+
117+
# Static files (CSS, JavaScript, Images)
118+
# https://docs.djangoproject.com/en/1.10/howto/static-files/
119+
120+
STATIC_URL = '/static/'

0 commit comments

Comments
 (0)