To Be Safe For Now Keep your shapefiles

  • Slides: 30
Download presentation
To Be Safe For Now: • Keep your shapefiles simple – Remove unneeded attributes

To Be Safe For Now: • Keep your shapefiles simple – Remove unneeded attributes – “Simplify” spatial data – Pyramids are coming soon • Only allow “info boxes” on points – Allows the user to drag everywhere else

Web Development • Web development never ends: 1. Find out what the stakeholders need

Web Development • Web development never ends: 1. Find out what the stakeholders need (sponsors, users, etc. ) 2. Investigate available technology 3. Plan the project 4. Build/update the web site 5. Test functionality in all browsers 6. Release the site 7. Monitor and maintain 8. Go to 1.

Technical Issues • • Keeping a web site available Maintaining a server Getting “hacked”

Technical Issues • • Keeping a web site available Maintaining a server Getting “hacked” Performance problems

Bottom Line • If your web site is not available: – You don’t exist!

Bottom Line • If your web site is not available: – You don’t exist!

What is a web server? • Has a “hard IP”. – An IP address

What is a web server? • Has a “hard IP”. – An IP address that never changes • Runs “web server” software – Typically IIS or Apache • Typically: – Is in a “rack” in a protected space that is: • Is environmentally controlled (air conditioned) • Has “conditioned” power (a UPS) – Has redundant components

Maintaining a server • You can “rent” space on a server – Drop. Box

Maintaining a server • You can “rent” space on a server – Drop. Box offers a “Public” folder • A server costs from $500 to $100, 000 – Don’t listen to what the manufacturers tell you what you need! Talk to other developers. • It costs $100 to $200 per month to have someone “host” your server. • In theory, you could have a server at your house but it is not recommended

Software • Keep the server as simple as possible – Complexity = more failures

Software • Keep the server as simple as possible – Complexity = more failures • Limit access • Do required updates • There are web site that will monitor your server and email you if it goes down

Getting Hacked • Common Types: – SQL Injection – “Stealing Bandwidth” – Web Server

Getting Hacked • Common Types: – SQL Injection – “Stealing Bandwidth” – Web Server breach – Uploading viruses – Denial of service errors • These can cause: – 404 Errors (web page unavaialble) – Web pages being replaced – Getting billed $1000 s of dollars! – Information being stolen?

SQL Injection • In a query string, enter: – “Query; DELETE FROM ‘<table>’” –

SQL Injection • In a query string, enter: – “Query; DELETE FROM ‘<table>’” – Deletes the entire contents of the table • Can also steal info from DB • Easy to protect from: – Check for single quotes and replace them with two single quotes – Don’t allow “delete from” in a query – Don’t allow sensitive information in your database

Stealing Bandwidth • Someone breaks into your server and puts a bunch of data

Stealing Bandwidth • Someone breaks into your server and puts a bunch of data there. Then, they make you their download site • Causes a massive spike in bandwidth which you have to pay for! • Preventing: – Don’t have FTP sites – Keep web software up to date – Make sure your ISP monitors for them

Web Server Breach • An HTML steam that breaks your web server and then

Web Server Breach • An HTML steam that breaks your web server and then takes over your server. • Used to steal band width and corrupt your server’s contents • Preventing: – These are rare and can only be prevented by the web server software provider – Keep web server software up to date

Uploading Viruses • User’s upload a file that than runs a program or “sleeps”

Uploading Viruses • User’s upload a file that than runs a program or “sleeps” until users download it to their computer – Allows others to get you to distributed viruses! • Don’t allow “scripts” to be uploaded. This includes: – “xls”, “doc”, “ppt” files!

Denial of Server • A web service is written that calls your web site

Denial of Server • A web service is written that calls your web site over and over again to “bring it down”. • IIS can crash with these • Preventing: – Don’t attract attention • If you do, get a lot of servers – Block abusive users – Only allow reasonable web service calls

Reality • Getting hacked today is rare – Twice in last 10 years (never

Reality • Getting hacked today is rare – Twice in last 10 years (never in last 7) • Keep the OS and web software up to date • Don’t let a lot of folks edit the contents of your server • Keep an eye on it • Other problems (like performance) will be bigger.

GIS Web Sites • GIS web sites “go bad” because of: – Poor user

GIS Web Sites • GIS web sites “go bad” because of: – Poor user design – Poor performance • New issues: – Scripting performance – Database performance – Geospatial data access

Scripting Performance • Load information on demand • Make sure there is minimal recursion

Scripting Performance • Load information on demand • Make sure there is minimal recursion – Functions calling functions, etc. – Loops in loops, etc. • Find the “bottlenecks” and fix them • Evaluate each library carefully and be ready to reject one and replace it

Database Performance • Don’t use MS-Access – Use My. SQL with small, simple data

Database Performance • Don’t use MS-Access – Use My. SQL with small, simple data • Use indexes (search trees) • Minimize string searches – Index if needed • Minimize hierarchical queries • Do performance analysis on key queries and add redundant data if needed • I’m evaluating a “No. SQL” database – Mongo. DB

Geospatial Issues • Pixels. vs geographic systems • Large datasets: – Pyramids of tiles

Geospatial Issues • Pixels. vs geographic systems • Large datasets: – Pyramids of tiles • Transfer speeds – The Internet is not getting any faster!

180 -180 90 Height in Pixels -90 Width in Pixels

180 -180 90 Height in Pixels -90 Width in Pixels

10, 000 meters UTM, Zone 10 6, 600, 000 meters

10, 000 meters UTM, Zone 10 6, 600, 000 meters

Pixels 0, 0 Positive Y Geospatial Coordinates Positive X Easting, Northing Negative Y Positive

Pixels 0, 0 Positive Y Geospatial Coordinates Positive X Easting, Northing Negative Y Positive X

Raster Pyramids • Problem: – Rasters can be huge! – The Internet is slow

Raster Pyramids • Problem: – Rasters can be huge! – The Internet is slow • Analysis: – Users can only view about 1000 x 1000 pixels at time – Options: • Large area at low resolution • Small area at high resolution • Solution: – Create a “pyramid” of tiles and only transfer the tiles that are needed

Raster Pyramid

Raster Pyramid

Zoom Level 1 0, 0 256, 256

Zoom Level 1 0, 0 256, 256

0, 0 0 Columns 1 Zoom Level 2 0 Rows 1 512, 512

0, 0 0 Columns 1 Zoom Level 2 0 Rows 1 512, 512

0, 0 0 Columns 1 Zoom Level 3 0 Rows 1 512, 512

0, 0 0 Columns 1 Zoom Level 3 0 Rows 1 512, 512

0, 0 0 1 Columns Zoom Level 4 0 1 Rows 512, 512

0, 0 0 1 Columns Zoom Level 4 0 1 Rows 512, 512

Zoom Level Pixel Width Num Columns 1 2 3 4 256 512 1024 2048

Zoom Level Pixel Width Num Columns 1 2 3 4 256 512 1024 2048 1 2 4 8 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 1. 7 E+07 3. 4 E+07 6. 7 E+07 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 Sum: Size (Pixels) 65536 262144 1048576 4194304 16777216 67108864 268435456 1073741824 4294967296 17179869184 68719476736 2. 74878 E+11 1. 09951 E+12 4. 39805 E+12 1. 75922 E+13 7. 03687 E+13 2. 81475 E+14 1. 1259 E+15 4. 5036 E+15 6. 0048 E+15 Num Tiles 1 4 16 64 256 1024 4096 16384 65536 262144 1048576 4194304 16777216 67108864 268435456 1073741824 4294967296 17179869184 68719476736 91625968981

Vector Pyramids • Vector data is getting larger – Millions of points – Complex,

Vector Pyramids • Vector data is getting larger – Millions of points – Complex, global polygons – Detailed polyline networks (rivers, roads) • Canvas. Map now has Vector Pyramids! – But they are really new so expected issues.