|
POST
|
Thank you. I noticed that not only 0 in PID. there are some # already in PID. how can avoid duplicate sequential # and existing # in PID field if it happens? I am not able to change what # is already created except "0" due to production. That screenshot you provide , it looks like trigger already after it calculated a field set up then every time it creates a new row? or do i need to do that every time manual set up calculate a field?
... View more
03-16-2021
04:08 PM
|
0
|
0
|
3467
|
|
POST
|
ArcGIS Pro 2.7.1, and SDE 1) how to generate or populating in a new # in a field that is already created in exist sde feature class for example 100,101,102 each row? Right now it is 0. 2) How do I generate or populating a new # in order in a field every time a new row is create in exist feature class? again, example, 101,102,103 Please kindly advise. Thank you Alex
... View more
03-16-2021
02:26 PM
|
0
|
9
|
3525
|
|
POST
|
Ok thank you i am checking on my end and will get it back.
... View more
03-16-2021
02:18 PM
|
0
|
0
|
2054
|
|
POST
|
Hello, I have ArcGIS Pro 2.7.1 and ArcMap 10.7.1 along with python 2.7 and 3x and model builder. I have a python script but I am missing something. In script after shapefiles/GDB/feature classes extract it all from zipped folder, how do I define query in some specific feature classes? I can provide more info if needed. Please kindly advise. Thank you, Alex #Create the table
try:
table_stm = """DROP TABLE sde.TEST."""+table_name+""" """
cursor.execute(table_stm)
connection.commit()
print table_name+' Table Deleted'
except Exception as crt:
print str(crt)
try:
table_stm = """CREATE TABLE sde.TEST."""+table_name+"""("""+columns+""") """
cursor.execute(table_stm)
connection.commit()
print table_name+' Table created'
except Exception as crt:
print str(crt)
#Read lines and Insert records
inserted_records = 0
line_id = 0
breakLoop = 0
for line in open(data_filename, 'r'):
line_string = line.rstrip() # strip off newline and any other trailing whitespace
values = line_string.split("|")
#if breakLoop:
#break
if len(values) > 0:
if values[0].strip()[:2] == '35':
breakLoop = 1
#values.pop()
#for each value in the file line
for i in xrange(len(values)):
#_q = ", ".join(["%s"] * len(values))
col_type = types[i]
#value = "'"+values[i].strip()+"'"
value = values[i].strip()
if value == ".0" or value == ".00":
value = "0"
#if value == " " or value == "":
#value = NULL
# if 'NUMERIC' in col_type:
# if value == " " or value == "":
#value = "null"
# else:
# value = 'CONVERT('+col_type+','+value+')'
#else:
value = "'"+value.replace("'","''")+"'"
values[i] = value
try:
values_string = ','.join(values)
SQLCommand = ("INSERT INTO sde.TEST."+table_name+" VALUES ("+values_string+")")
line_id = line_id + 1
cursor.execute(SQLCommand)
connection.commit()
inserted_records = inserted_records + 1
except Exception as inst:
log_write(log_file, '..Error inserting record in'+table_name+':'+str(line_id) +' Command :'+SQLCommand)
except Exception as inst:
log_write(log_file, '...Error processing '+data_filename+' file:'+str(inst))
else:
connection.commit()
cursor.close()
connection.close()
log_write(log_file, '.Finished processing '+data_filename+' file. Total records inserted:'+str(inserted_records))
... View more
03-15-2021
01:19 PM
|
0
|
4
|
2101
|
|
POST
|
@DanPatterson @MichaelVolz When I tried to append tool from sde feature class to sde feature class (view), it failed and gave an error. Am I missing something?
... View more
03-14-2021
09:39 PM
|
0
|
0
|
4234
|
|
POST
|
It is fixed now and yes, it is working with (). Thank you @DanPatterson
... View more
03-14-2021
09:25 PM
|
0
|
0
|
4711
|
|
POST
|
I am a bit lost. Is this what you meant as below? Please correct me if I am wrong. # coding: utf-8
# In[5]:
from arcgis.gis import GIS
# Python Standard Library Modules
from pathlib import Path, PurePath
from zipfile import ZipFile
public_data_item_id = '123'
anon_gis = GIS(username="test", password="test")
data_item = anon_gis.content.get(public_data_item_id)
data_path = Path = r('C:\ArcGISETL\DataLoads\test\WeeklyParcelPoly\test')
if not data_path.exists():
data_path.mkdir()
zip_path = data_path.joinpath('PAData.zip')
extract_path = data_path.joinpath('PADataDatasets')
data_item.download(save_path=data_path)
print(path)
C:\ArcGISETL\DataLoads\test\WeeklyParcelPoly\test
... View more
03-14-2021
06:19 PM
|
0
|
0
|
4758
|
|
POST
|
I am stuck. I have python 2.7.16, ArcGIS Pro 2.7.1 and ArcMap 10.7.1 on the machine. I have a python script stand alone. It said it already run but then I have an error (0x2) with window task scheduler. I provided screenshots and one of pieces python script below. Please advise. I can provide more screenshots / info if needed. It used to work but now I am not sure what is going on. It needs to be download zip file folder and extract it all from ArcGIS online to windows machine. It is actually working download zipped folder but it doesn't work to extract it all anymore. UNDER ACTION TAB: #1 START A PROGRAM: Program/script: C:\ArcGISETL\DataLoads\test\WeeklyParcelPoly\DownloadPAData.bat #2 START A PROGRAM: Program/script: C:\Python27\ArcGISx6410.7\python.exe Add arguments (optional): C:\ArcGISETL\DataLoads\test\WeeklyParcelPoly\test_Weekly_GDB_OpenData - Copy.py # coding: utf-8
# In[5]:
from arcgis.gis import GIS
# Python Standard Library Modules
from pathlib import Path, PurePath
from zipfile import ZipFile
public_data_item_id = '123'
anon_gis = GIS(username="test", password="test")
data_item = anon_gis.content.get(public_data_item_id)
data_path = Path('C:\ArcGISETL\DataLoads\test\WeeklyParcelPoly\test')
if not data_path.exists():
data_path.mkdir()
zip_path = data_path.joinpath('PAData.zip')
extract_path = data_path.joinpath('PADataDatasets')
data_item.download(save_path=data_path)
print (PurePath(zip_path))
... View more
03-14-2021
05:33 PM
|
0
|
5
|
4773
|
|
POST
|
I just noticed that I actually have TWO feature classes to ONE feature class. Is this possible? Is this gonna be an issue when I append and delete identical? such as to do this weekly.
... View more
03-14-2021
02:26 PM
|
0
|
0
|
4240
|
|
POST
|
Can you please explain how does this work? Is there a step by step?
... View more
03-14-2021
02:20 PM
|
0
|
0
|
891
|
|
POST
|
Yes, thank you. I tested it and this is piece what I am looking for.
... View more
03-14-2021
02:18 PM
|
0
|
0
|
4242
|
|
POST
|
Thank you for the information. Either shapes or attributes. After reading the document, it is look like field only. Not sure if I am understanding. For example below, can it delete row by using two specific fields?
... View more
03-13-2021
06:25 PM
|
0
|
7
|
4302
|
|
POST
|
What tools should I use to avoid duplicate information after using append tool?
... View more
03-13-2021
03:37 PM
|
0
|
0
|
4315
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-30-2021 01:32 PM | |
| 1 | 04-01-2025 12:12 PM | |
| 1 | 05-12-2021 10:12 AM | |
| 1 | 07-25-2018 12:53 PM | |
| 1 | 08-06-2018 12:27 PM |