• Content count

  • Joined

  • Last visited

  • Days Won


yousef2233 last won the day on December 28 2016

yousef2233 had the most liked content!

Community Reputation

257 Famous

About yousef2233

  • Rank

Contact Methods

  • Yahoo
    [email protected]

Profile Information

  • Gender
    Not Telling
  • Interests
    Network Analysis :D
  1. Use ArcPy instead. I sent you the sample code in pm
  2. Its not that easy, it makes some gaps and overlap some times 1 - do you care about topology rules ? 2 - how much is your accuracy ?
  3. I think you should use cursors like this input_fc="fc" field = "buffer_value_field" output = "fc_somewhere" output_temp = "fc_somewhereElse" cursor = arcpy.da.SearchCursor(input_fc) for row in cursor: arcpy.analysis.Buffer(input_fc,row.getValue(field),output_temp),output,"NO_TEST") it does not work in the append process, I just made a conceptual example for you
  4. first thing on my mind is: 1 - convert end of your line to point - ( 2 - add points based on function(length, deflection) which based on last point on OID list [email protected] it calculates new XY maybe you can do it with tables only 3 - create a line based on points created in last step and then add it to first line you had 4 - do step 2 and 3 over and over again till end of your list
  5. I didnt check your file, but the solution is sth like this fc = "your_featureclass" fields = ["road_name_field"] cursor = arcpy.da.UpdateCursor(fc, fields) for row in cursor: full_name = [] full_name = row[0].split(" ") road_type = full_name[-1] if road_type = "ST": full_name[-1] = "STREET" elif road_type = "RD": full_name[-1] = "ROAD" result= full_name[:-1] result.append(full_name[-1]) row[0]= " ".join(result) cursor.updateRow(row)
  6. Dear Friends, Me and my colleagues are trying to make an application for routing purposes. This application has to be in a mutual transaction with a GPS tracking device obviously. Here come the issues we encounter 1. We are getting the login data but after that we need to send response to device with a format that device can verify server and then send actual GPS data to server. 2. We are not able to send login data to that device so that's why device not send us GPS data. 3. Login Data we are getting is like :- 2323101501f357367031649441529625060. 4. We are not getting further process what to do to get Device GPS data to our server. We have asked for the GPS device support, no useful information but offering their own portal. and here is the code developed for this transaction : package com.trackit; import; import; import; import; import; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class ServerListener { public static void main(String[] args) { new ServerListener().startServer(); } public void startServer() { final ExecutorService clientProcessingPool = Executors.newFixedThreadPool(03); Runnable serverTask = new Runnable() { @SuppressWarnings("resource") @Override public void run() { try { ServerSocket serverSocket = new ServerSocket(5094); System.out.println("Waiting for clients to connect..."); while (true) { Socket clientSocket = serverSocket.accept(); clientProcessingPool.submit(new ClientTask(clientSocket)); } } catch (IOException e) { System.err.println("Unable to process client request"); e.printStackTrace(); } } }; Thread serverThread = new Thread(serverTask); serverThread.start(); } private class ClientTask implements Runnable { private final Socket clientSocket; private ClientTask(Socket clientSocket) { this.clientSocket = clientSocket; } @Override public void run() { System.out.println("Got a client !"); try { BufferedReader reader = new BufferedReader( new InputStreamReader(clientSocket.getInputStream())); String clientData = ""; clientData = reader.readLine(); String hex_value = asciiToHex(clientData); System.out.println("Hex Value :-"+hex_value); } catch (IOException e) { e.printStackTrace(); } } private String asciiToHex(String clientData) { char[] chars = clientData.toCharArray(); StringBuffer hex = new StringBuffer(); for (int i = 0; i < chars.length; i++) { hex.append(Integer.toHexString((int)chars[i])); } return hex.toString(); } } } Any kind of tips and help is appreciated. Kindly Regards
  7. If size matters and the shape is not complex, give this a try: Maximizing(proportion of polygon(i).boundary(part).length which falls within a close buffer around base.polygon.boundary to polygon(i).boundary(full).length)
  8. Hi, Create mode 'c' Import: Tools > Shape File to Emme Conversion Create something like and myCity.db after Exporting copy myCity.db into database folder and rename db file to Scenario1001 then open up Modeller and find Process base network transaction select the new Scenario and and RUN back to Desktop and worksheet about exporting, search in modeller
  9. dear stephenhann, please post your sample raster map here and let us take a look regards,
  11. Check this '''---------------------------------------------------------------------------------- Tool Name: Multiple Ring Buffer Source Name: Version: ArcGIS 10.0 Author: Environmental Systems Research Institute Inc. Required Arguments: An input feature class or feature layer An output feature class A set of distances (multiple set of double values) Optional Arguments: The name of the field to contain the distance values (default="distance") Option to have the output dissolved (default="ALL") Description: Creates a set of buffers for the set of input features. The buffers are defined using a set of variable distances. The resulting feature class has the merged buffer polygons with or without overlapping polygons maintained as seperate features. ----------------------------------------------------------------------------------''' import arcgisscripting import os import sys import types import locale gp = arcgisscripting.create(9.3) #Define message constants so they may be translated easily msgBuffRings = gp.GetIDMessage(86149) #"Buffering distance " msgMergeRings = gp.GetIDMessage(86150) #"Merging rings..." msgDissolve = gp.GetIDMessage(86151) #"Dissolving overlapping boundaries..." def initiateMultiBuffer(): # Get the input argument values # Input FC input = gp.GetParameterAsText(0) # Output FC output = gp.GetParameterAsText(1) # Distances distances = gp.GetParameter(2) # Unit unit = gp.GetParameterAsText(3) if unit.lower() == "default": unit = "" # If no field name is specified, use the name "distance" by default fieldName = checkFieldName(gp, gp.GetParameterAsText(4), os.path.dirname(output)) #Dissolve option dissolveOption = gp.GetParameterAsText(5) # Outside Polygons outsidePolygons = gp.GetParameterAsText(6) if outsidePolygons.lower() == "true": sideType = "OUTSIDE_ONLY" else: sideType = "" createMultiBuffers(gp, input, output, distances, unit, fieldName, dissolveOption, sideType) def checkFieldName(gp, fieldName, workspace): if fieldName == "#" or fieldName == '': return "distance" else: outName = gp.ValidateFieldName(fieldName, workspace) outName = outName.replace(" ", "_") if outName != fieldName: gp.AddIDMessage("WARNING", 648, outName) return outName def convertValueTableToList(valTable): outList=[] for v in valTable.exporttostring().split(";"): outList.append(locale.atof(str(v))) return outList def lowerLicenseUnion(gp, fcList): unionFC = None tmpFC = gp.Union_analysis(fcList[0:2], gp.CreateUniqueName("union", scratchWks)).getOutput(0) for fc in fcList[2:]: if unionFC: tmpFC = unionFC unionFC = gp.Union_analysis([tmpFC, fc], gp.CreateUniqueName("union", scratchWks)).getOutput(0) return unionFC def createMultiBuffers(gp, input, output, distances, unit, fieldName, dissolveOption, sideType): try: global scratchWks # Assign empty values to aid with cleanup at the end # oldOW = None # Keep track of current settings that should be restored by end if not gp.overwriteOutput: oldOW = True gp.overwriteOutput = True scratchWks = gp.scratchGDB # Convert the distances into a Python list for ease of use distList = convertValueTableToList(distances) # Loop through each distance creating a new layer and then buffering the input. # Set the step progressor if there are > 1 rings if len(distList) > 1: gp.SetProgressor("step", "", 0, len(distList)) stepProg = True else: gp.SetProgressor("default") stepProg = False bufferedList = [] # Buffer the input for each buffer distance. If the fieldName is different than # the default, add a new field and calculate the proper value for dist in distList: if stepProg: gp.SetProgressorPosition() gp.SetProgressorLabel(msgBuffRings + str(dist) + "...") bufDistance = "%s %s" % (dist, unit) bufOutput = gp.Buffer_analysis(input, gp.CreateUniqueName("buffer", scratchWks), bufDistance, sideType, "", dissolveOption).getOutput(0) if fieldName.lower() != "buff_dist": gp.AddField_management(bufOutput, fieldName, "double") gp.CalculateField_management(bufOutput, fieldName, dist, "PYTHON") bufferedList.append(bufOutput) gp.ResetProgressor() gp.SetProgressor("default") gp.SetProgressorLabel(msgMergeRings) if dissolveOption == "ALL": # Set up the expression and codeblock variables for CalculateField to ensure # the distance field is populated properly expression = "pullDistance(" + str(distList) + ", " for fc in bufferedList: expression += "!FID_" + os.path.basename(fc) + "!, " expression = expression[:-2] + ")" # If we have a full license then Union all feature classes at once, otherwise # Union the feature classes 2 at a time if gp.ProductInfo().upper() in ["ARCINFO", "ARCSERVER"] or len(bufferedList) < 3: unionFC = gp.Union_analysis(bufferedList, gp.CreateUniqueName("union", scratchWks)).getOutput(0) codeblock = '''def pullDistance(distL, *fids): return min([i for i, j in zip(distL, fids) if j != -1])''' else: unionFC = lowerLicenseUnion(gp, bufferedList) codeblock = '''def pullDistance(distL, *fids): return min([i for i, j in zip(distL, fids) if j == 1])''' gp.CalculateField_management(unionFC, fieldName, expression, "PYTHON", codeblock) # Complete the final Dissolve gp.SetProgressorLabel(msgDissolve) if dissolveOption.upper() == "ALL": gp.Dissolve_management(unionFC, output, fieldName) else: # Reverse the order of the inputs so the features are appended from # largest to smallest buffer features. bufferedList.reverse() template = bufferedList[0] if gp.OutputCoordinateSystem: sr = gp.OutputCoordinateSystem else: sr = gp.Describe(template).spatialreference gp.CreateFeatureclass_management(os.path.dirname(output), os.path.basename(output), "POLYGON", template, "SAME_AS_TEMPLATE", "SAME_AS_TEMPLATE", sr) for fc in bufferedList: gp.Append_management(fc, output, "NO_TEST") if gp.ListFields(output, "buff_dist"): # Remove duplicate field gp.DeleteField_management(output, "buff_dist") # Set the default symbology params = gp.GetParameterInfo() if len(params) > 0: params[1].symbology = os.path.join(gp.GetInstallInfo()['InstallDir'], "arctoolbox\\templates\\layers\\multipleringbuffer.lyr") except arcgisscripting.ExecuteError: gp.AddError(gp.GetMessages(2)) except Exception as err: gp.AddError(err.message) if __name__ == '__main__': initiateMultiBuffer()
  12. What do you want to achieve by this? a little explanation about your purpose would help us understand your problem
  13. Welcome dude, I'm interested in spatial correlation methods, please share some of your knowledge with us many thanks
  14. I'm not sure if this is the solution some times addresses in identify server and pools change, and you have to run post installation again for checking the host addresses. and even go for xml files for corresponding addresses again. in some cases post installation does not work properly. very unstable software
  15. dear saifkhalidrao, if you simply install bluestacks software (its free) you can run android applications on it. about this specific application i dont know if it has a windows version or not.