I'm trying to convert a .mif file to GeoJSON. I've got .mif, .mid and .dbf. But when I convert it, the properties included in .dbf are not rendered in the GeoJson file. The command I use is : ogr2ogr -f GeoJSON file.json file.mif.
Is there something wrong with my command or do I need to add an option?
More infos:
With ogrinfo for the .dbf file :
ogrinfo car_m.dbf -so car_m
INFO: Open of `car_m.dbf'
using driver `ESRI Shapefile' successful.
Layer name: car_m
Metadata:
DBF_DATE_LAST_UPDATE=1913-10-18
Geometry: None
Feature Count: 2278213
Layer SRS WKT:
(unknown)
id: String (21.0)
idINSPIRE: String (30.0)
idk: String (25.0)
ind_c: Real (16.4)
nbcar: Real (16.4)
And from .mid :
Geometry: Unknown (any)
Feature Count: 2278213
Extent: (48385.790000, 1620790.500000) - (1197778.210000, 2676806.350000)
Layer SRS WKT:
PROJCS["unnamed",
GEOGCS["unnamed",...]
idINSPIRE: String (30.0)
id: String (21.0)
A solution : I converted the .mif in two steps, using .shp and merging the DBF file generated with the original one before converting to GeoJson, as relations are .mif/.mid and .shx/.shp/.dbf.
Related
I'm going to put the csv file into the bucket using influxdb v2.1.
Attempting to insert a simple example file results in the following error:
error in csv.from(): failed to read metadata: failed to read annotations: expected annotation datatype
The csv file that I was going to write is as follows.
#datatype measurement,tag,double,dateTime:RFC3339
m,host,used_percent,time
mem,host1,64.23,2020-01-01T00:00:00Z
mem,host2,72.01,2020-01-01T00:00:00Z
mem,host1,62.61,2020-01-01T00:00:10Z
mem,host2,72.98,2020-01-01T00:00:10Z
mem,host1,63.40,2020-01-01T00:00:20Z
mem,host2,73.77,2020-01-01T00:00:20Z
This is the example data in the official document of influxdata.
If you look at the first line of the example, you can see that datatype is annotated, but why does the error occur?
How should I modify it?
This looks like invalid annotated CVS.
In the csv.from function documentation, you can find examples (as string literals) of both annotated and raw CVS that the cvs.from supports.
I use OTB (Orfeo Tool Box) in QGis for classification. When I use the ImageTrainClassifier tool in a batch process, I have a problem for some images. Instead of returning a model in a xml/txt file format, it returns several files with those extensions : .xml_rates_1, .xml_samples_1.dbf, .xml_samples_1.prj, .xml_samples_1.shp, .xml_samples_1.shx, .xml_stats_1 (I have the same files with txt instead of xml if I use txt file format as output).
During the execution of the algorithms, I have only one warning message :
(WARNING): file ..\Modules\Learning\Sampling\src\otbSamplingRateCalculatorList.cxx, line 99, SamplingRateCalculatorList (00000283DDC3C0E0): All classes are empty !
And after that :
(FATAL) TrainImagesClassifier: No samples found in the inputs!
The problem is that after that, I want to use ImageClassifier, that takes the model of ImageTrainClassifier in input, that I don’t have.
Thanks for your help
I'm trying to decode a string which is encoded using LZX algorithm with a LZX window size of 2 megabytes (binary) and then converted to base64.
I'm receiving this string in response from Microsoft's Update API (GetUpdateData).
As per Microsoft documentation for the lzx/lz77 algorithm, the XmlUpdateBlobCompressed field is:
compressed using a LZX variant of the Lempel-Ziv compression algorithm. The LZX window size used for compressing this field is 2 megabytes.
I tried to decode/decompress the string back to its original XML with no success. I tried the lz_string library (NodeJS/Ruby) and some other libraries but had no success so far.
Here is a sample I'm trying to decode/decompress back to the original XML:
TVNDRgAAAACPIwAAAAAAACwAAAAAAAAAAwEBAAEAAAAAAAAAQQAAAAIAAxVIwwAAAAAAAAAAAAAAAAAAYmxvYgCF1k7pgBgAgFuAgI0MIIQ0QRAABDMDNSMAYAAAaW+qrcgkd7l8ck7bM0VOsi0C+61/XVRtf4SU9i2F0gKBAO2Bv7e37Zu22t50m5yTNmlRiEcikSCfz+5ztUnyzQoR9BaupQIpgBYaiaUIHGOuCNSOXBj5SFWJcDqQuSIAmSGAmgMARjDL0O1rqggvgGaQNgADBjP2RgIHw83o+jG9NdKT1j66rC8nipxrKyXpu7a+U12KV1Y/Lp04nt1ciiLplJP1krgxgp/KKfoaQ0WciCcMGSZKrrthho0lCw74DWx/OP//0P8AgAkAzRCAAYMVv36tX53uSzpTWmkzSKRh6FuWLSth3gmmooIhPgvw6IBgurCPR0BC1OiZ6h/SJNAzkD9g7zBSUaQCSIKYnpwqmslQxUKKG4VzCiKUQ1AudsB7tZgSkDIDYp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1FU7Ibr3caR5po6rNZQ1TFO7Uh4jeO+JA+hkWw7muVAMZ7ITHQ9i6Ay4Ma6M7cKzfebYsnUhqZGPpw9Nx/a7W6NeNXEzZ7Tt6k7g3GTi59IzhO7SYdyl7E+d49BVee/KoxbUu2OMM6stRyAPodbtnRY/ds7dWqyK1SOF6leR98gxL3DHHMR6SvGFD2KO0rZwqZ2M9AXjotJomUg9WVqovPvnZ1FuiAR+tLY52c9hdrkz1JCZz4tLNEtW3q1UauvluOoBWXIfFmJLa7U53qJ3QsXw4MbbpRN/Om7hKN68u1udURZuK4TzqgJYAZ3G0LbnNuo8TmDtHO7ZXylns2nfcbjqCarY7FkL2mxWcXVU81a+IZjurno+rOVm4uPLZPVkNAPJSW6Z81ixzyOdwvujjTVBjkefGzZVufr3YAdxtHp+klnd2TjeOwyoLdZgcBu071fhzb+lenvbFc6XpiHn9wl0S49RxMDktEbbS1kO2huG7MBv//SgtEgFtHeNju6ducFUatT7te62cI0y3jqsPmYddFf7telkjleeq+mLHM+dd+M/G2Nbc13BBFdzxObiwJbPxU/kP62Uqq4zN7dY+bS0iKdG3r31Vc4xoV69dAULH3rxr4wYWgd1Mh6YB5vm7AacMYpk2UK6xcuALsrPJC49282vVLVBLY1cZiitzrTmfOnaOcrOV7RxBAAednIjwwNH2ZwCTO9VNxuBQVQPtAW7OQJjq1T4uj6Wavnni22Xj+My2O4YlTsNREWzgCL2Y2Gbb4GZiifMM2gLNyenuXRdU9TSwIw+RDrfuJyhcGxOpnccp5F/l++Qpu72rOJR7mxphiKYABw==
Has anybody had success doing this?
As added in comment by Dave, it was the cab file which was there in response.
I have saved the cab file & extracted it using libmspack
cab_file_path = "/Users/kalpesh/playground/xml.cab"
cab_file = File.open(cab_file_path, "wb")
# Save Cab file
cab_file.puts Base64.decode64(xml_blob) # xml_blob is the sample which I have given in description
# Extract cab file
blob_xml_path = "/Users/kalpesh/playground/xml_blob.txt"
cab_decompressor = LibMsPack::CabDecompressor.new
cab = cab_decompressor.open(cab_file_path)
cab_decompressor.extract(cab.files, blob_xml_path)
I have a custom connector that writes Neo4j commands from a file to Kafka and I would like to debug it. So, I downloaded Confluent v3.3.0 and took time familiarize myself with it; however, I find myself stuck trying to load the connector. When I try to load the connector with its .properties file I get the following error:
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1, column 124
parse error: Invalid numeric literal at line 2, column 0
I have an inkling that it is trying to parse the file as a JSON file as before this error I got the following error when trying to load the connector:
Warning: Install 'jq' to add support for parsing JSON
And so I brew installed jq, and now having been getting the former error.
I would like this file to be parsed as java properties format which I thought would be implicit due to the .properties, but do I need to be explicit in a setting somewhere?
Update:
I converted the .properties to JSON as suggested by #Konstantine Karantasis, but I get the same error as before but without the first line:
parse error: Invalid numeric literal at line 2, column 0
I triple checked my formatting and did some searching on the error, but have come up short. Please let me know if I made an error in my formatting or if there is a nuance when using JSON files with Kafka Connect that I don't about.
Java properties:
name=neo4k-file-source
connector.class=neo4k.filestream.source.Neo4jFileStreamSourceConnector
tasks.max=1
file=Neo4jCommands.txt
topic=neo4j-commands
Converted to JSON:
[{
"name": "neo4k-file-source",
"connector": {
"class": "neo4k.filestream.source.Neo4jFileStreamSourceConnector"
},
"tasks": {
"max": 1
},
"file": "Neo4jCommands.txt",
"topic": "neo4j-commands"
}]
Check out https://www.confluent.io/blog/simplest-useful-kafka-connect-data-pipeline-world-thereabouts-part-1/ for an example of a valid json file being loaded using confluent CLI
In your example, try this:
{
"name": "neo4k-file-source",
"config": {
"connector.class": "neo4k.filestream.source.Neo4jFileStreamSourceConnector",
"tasks.max": 1,
"file": "Neo4jCommands.txt",
"topic": "neo4j-commands"
}
}
Confluent CLI, which you are using to start your connector, tries to be smart about figuring out the type of your properties file. It doesn't depend on the extension name (.properties) but calls file on the input file and matches the result against the ASCII string.
This complies with the current definition of a java properties file (https://en.wikipedia.org/wiki/.properties) but it should be extended to match files encoded in UTF-8 or files that contain escaped unicode characters.
You have two options.
Transform your properties to JSON format instead.
Edit the CLI to match the file type returned when running file <yourconf.properties>
I have a decrypted VPN pcap file. What I am trying to do is to read the pcap using tcptrace in linux. But, tcptrace does not seem to get this format that I have.
So here is the snapshot of the pcap. This is the pcap
So, what I want to do is to remove the 12 bytes, ENC header and then add a 14 byte ethernet header there.
I am not sure how to do that. I would typically like to separate a pcap that contains only requests and add a ethernet header after removing 12 bytes of ENC header.
Similarly create a pcap for reply's.
Can someone please help me on how to do this?
If tcptrace can handle pcap files with Linktype Raw, then you can use editcap to strip the first 12 bytes from the packets and not even bother with adding a dummy Ethernet header if you save the file with the rawip encapsulation. For example:
editcap infile.pcapng outfile.pcap -L -C 12 -T rawip -F pcap
Note: Here I used the -F pcap option to force the output file to be saved as a pcap file instead of a pcapng file, because I don't know if tcptrace supports pcapng files or not, and pcapng is the default output file type that editcap uses if you don't specify the output file type.
If tcptrace does not support Linktype Raw, then you should still be able to accomplish what you need, but you'll have to take the output file generated from editcap above and manipulate it further. Since editcap itself doesn't support adding a dummy Ethernet header to the packets, you can use Wireshark to save the packets to a text file and then convert the text file back to a pcap file, but when you convert it back to a pcap file, you will have the option of adding a dummy Ethernet header to the packets. That last step can also be accomplished with text2pcap. Here are the steps to follow using Wireshark:
Load the outfile.pcap file: File -> Open... -> File name: outfile.pcap.
Temporarily disable the IPv4 protocol. This is to ensure that reassembly does not occur; otherwise the output text file will not be generated in a format suitable to be imported later on should any reassembly occur: Analyze -> Enabled Protocols -> Protocols -> IPv4 -> De-select -> Apply.
Remove or hide all columns and add an absolute time column. This allows you to export the timestamp, and while not strictly required, it is very useful: Edit -> Preferences -> Columns -> De-select all columns; Add -> Field type: Absolute date, as YYYY-MM-DD, and time; Title "AbsTime" -> OK. (Note: It might be easier to create a separate Profile for "Pcap2Text" purposes in which only this column is displayed. This allows you to quickly change to this profile whenever you want to perform this operation again without affecting the columns of any other working profile.)
Export the packets to a text file: File -> Export Packet Dissections -> as "Plain Text" file... -> File name: outfile.txt; Packet Range: All packets; Packet Format: Select Packet summary line (but not column headings) and Packet Bytes.
Re-enable the IPv4 protocol: Analyze -> Enabled Protocols -> Protocols -> IPv4 -> Select -> OK.
Close the original output.pcap file.
Import the output.txt text file: File -> Import from Hex Dump... -> Filename: output.txt; Offsets: Hexadecimal; Date/Time: Select; Format: "%F %T." (no quotes, but the trailing '.' is important - this is the default); Import Encapsulation type: Ethernet; Dummy header: Select; Ethernet Ethertype (hex): 0800 -> OK.
Save the file: File -> Save As... -> File name: newfile_with_dummy_ethernet_header.pcap, Save as type: Wireshark/tcpdump/...- pcap (.pcap;.pcap.gz;.cap;.cap.gz;.dmp;.dmp.gz)
This file should now be readable by tcptrace. I can't promise that this is the most expedient method to achieve your goal, but at least it works in creating a pcap file with Ethernet encapsulation that tcptrace should be able to read.
Disclaimer: These instructions were generated using Wireshark 1.12.13 running on Windows 7 64-bit, or more specifically:
Compiled (64-bit) with GTK+ 2.24.23, with Cairo 1.10.2, with Pango 1.34.0, with
GLib 2.38.0, with WinPcap (4_1_3), with libz 1.2.5, with SMI 0.4.8, with c-ares
1.9.1, with Lua 5.2, without Python, with GnuTLS 3.2.15, with Gcrypt 1.6.2,
without Kerberos, with GeoIP, with PortAudio V19-devel (built Jul 28 2016), with
AirPcap.
Running on 64-bit Windows 7 Service Pack 1, build 7601, with WinPcap version
4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch
1_0_rel0b (20091008), GnuTLS 3.2.15, Gcrypt 1.6.2, with AirPcap 4.1.3 build
3348.
Intel(R) Core(TM) i5-2540M CPU # 2.60GHz, with 8072MB of physical memory.
Built using Microsoft Visual C++ 10.0 build 30319