Skip to content

Commit

Permalink
Version 1.1 Updated
Browse files Browse the repository at this point in the history
Version 1.1 Updated
  • Loading branch information
kikitaMoon committed Jul 20, 2018
2 parents 16e4489 + 5611968 commit 07e7140
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@ ENV/
# mypy
.mypy_cache/
.idea/workspace.xml
.idea/workspace.xml
12 changes: 6 additions & 6 deletions python/updateVectorTilePackage.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# _*_ coding: utf-8 _*_
# !/usr/bin/python
__author__ = 'ma_keling'
# Version : 1.0
# Version : 1.1.0
# Start Time : 2017-12-07
# Update Time : 2018-7-20
# Change Log :
## 1. # Update the path of vector tile cache, adapt to the new vtpk folder structures.
##

import os
import zipfile
Expand Down Expand Up @@ -37,10 +37,14 @@ def retype(workspace,newPartVtpkPath,newtype):
os.rename(olddir, newdir)
arcpy.AddMessage("has changed:" + newdir)
return newdir

except:
delete_zip_folder(workspace)
arcpy.AddError("retype failed: please provide a validates path")




#uncompress the .zip file to folder
def unzip(workspace,newPartZipPath):
try:
Expand Down Expand Up @@ -116,11 +120,7 @@ def copy_files(workspace,oldvtpath=None, newvtpath=None):
# return the unzip local tile path include LODs
def get_tile_path(extract_folder):
# # for windows path
# update at 2018-7-20,adapt to the new vtpk folder structures.
tilePath = os.path.join(extract_folder, 'p12\\tile')

# Applies to versions prior to pro2.2
# tilePath = os.path.join(extract_folder, 'p12\\tile')
print("local new part tile path:", tilePath)
return tilePath

Expand Down
17 changes: 4 additions & 13 deletions python/updateVectorTileService.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# _*_ coding: utf-8 _*_
# !/usr/bin/python
__author__ = 'ma_keling'
# Version : 1.0
# Version : 1.1.0
# Start Time : 2017-12-07
# Update Time : 2018-7-20
# Change Log :
## 1. # Update the path of vector tile cache, adapt to the new vtpk folder structures.
##

import os
import sys
Expand Down Expand Up @@ -52,7 +52,7 @@ def main(argv=None):

execute(update_vtpk_path, service_url, ags_username, ags_password, share_hostname,
share_admin, share_password)

#common http tools
#assistant method for submit request
def submit_request(url,params,item=""):
Expand Down Expand Up @@ -347,19 +347,10 @@ def get_local_cache_path(upate_vtpk_path):
unzip_path = unzip(zip_path)

if unzip_path[:1] == r"/":
# update at 2018-7-20,adapt to the new vtpk folder structures.
cache_path = os.path.join(unzip_path, 'p12/tile')

# Applies to versions prior to pro2.2
#cache_path = os.path.join(unzip_path,'p12/tile')
cache_path = os.path.join(unzip_path,'p12/tile')
else:

# update at 2018-7-20,adapt to the new vtpk folder structures.
cache_path = os.path.join(unzip_path, 'p12/tile')

# Applies to versions prior to pro2.2
#cache_path = os.path.join(unzip_path, 'p12\\tile')

return cache_path

# execute method for arcgis gp tool
Expand Down
10 changes: 2 additions & 8 deletions python/updateVectorTileforOSS.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# _*_ coding: utf-8 _*_
# !/usr/bin/python
__author__ = 'ma_keling'
# Version : 1.0
# Version : 1.1.0
# Start Time : 2017-12-07
# Update Time : 2018-7-20
# Change Log :
## 1. # Update the path of vector tile cache, adapt to the new vtpk folder structures.
##

import os
import sys
Expand Down Expand Up @@ -104,14 +104,8 @@ def get_local_tile_path(newPartVtpkPath):
# for mac path
# tilePath = extractFolder + '/p12/tile'

# update at 2018-7-20,adapt to the new vtpk folder structures.
# for windows path
tilePath = os.path.join(extractFolder, 'p12\\tile')


#Applies to versions prior to pro2.2
# for windows path
# tilePath = os.path.join(extractFolder, 'p12\\tile')
print("local new part tile path:", tilePath)
return tilePath

Expand Down

0 comments on commit 07e7140

Please sign in to comment.