Добрый день!
Уже несколько недель борюсь с Surfer, отличная программа, но в плане координат мы друг друга не понимаем совершенно, решил обратиться на форум за поддержкой разбирающихся.
Ситуация:
В SasPlanet наносим точки, после чего вытаскиваем их через KML или GPX с последующим преобразованием в CSV-файл, который понимает Surfer. В CSV координаты в формате XX.XXXXXX YY.YYYYYY и не отходя от кассы, добавляем новый столбец со значениями высоты. Загружаем всё это дело через Grid Data в Surfer. Выставляем XYZ — он всё понимает и принимает. Строится карта.
Проблема:
Результат получается сжатым по вертикали (может растянут по горизонтали)! Суть в том, что это не то же самое, что выгружалось с SasPlanet (скрины прикладываю (в наложении совмещал по «скв 15»)), а надо чтобы прям наложение было идеальное.
Казалось бы, в таком случае надо менять систему координат. И вот тут и появляется загвоздка — систем координат полно и я чего-то не понимаю. Начитался в интернетах, что SAS имеет систему координат — Popular Visualisation CRS / Mercator (EPSG 3785). Ставил — ничего не поменялось. В ArcMAP была подобная ситуация, но там всё решалось выставлением системы координат СК-42 c указанием зоны. Тогда расстояния между точками совпадало с SAS и никакого искажения не было, можно было выгружать и накладывать — всё совпадало абсолютно до мм.
Обратил внимание на то, что в Surfer систему координат можно применить как к группе «Map», так и для слоя группы с точками, причем разную систему можно поставить — скорее всего я здесь что-то не понимаю и здесь кроется ошибка. Я перепробовал много систем координат WGS 84, СК-42, разные EPSG и много комбинаций «система координат MAP — система координат слой».
На форумы редко хожу, обычно методом «тыка» решение появляется, но тут прям плакать хочется.
Заранее отвечу на некоторые вопросы:
1. «Ошибка в импорте KML и преобразовании в CSV» — я проверял, он импортирует правильные координаты.
2. «Не подбивал масштаб при наложении» — подбивал.
ERROR: insufficient data left in message Where: COPY registrations, line 1, column user_id
Копирую из разных баз/серверов.
COPY t FROM ‘/tmp/t.bin’ WITH (FORMAT BINARY );
COPY t TO ‘/tmp/t.csv’ CSV BINARY;
Подоздреваю, что проблема со столбцом, у которого тип timestmap… Возможно
Подскажите, как можно решить вопрос?
russian
programming
pgsql
5
ответов
Форматы таблиц небост разные?
Ilya Anfimov
Форматы таблиц небост разные?
Таблицы разные.
Но типы данных столбцов одинаковы.
int и timestamp
Ilya Anfimov
Форматы таблиц небост разные?
Еще тупой вопрос.
Я пробовал не в бинарном формате, а в csv.
Но столкнулся с тем, что в некоторых редких случаях timestamp в файле имел вид 2021-01-01 10:11:12.
Т.е. там не было цифр в конце, после точки. И из-за этого тоже импорт приостанавливаля.
Можно ли как-то заставить postgres при создании csv доставлять 000000 после точки в timestmap?
whois
Еще тупой вопрос.
Я пробовал не в бинарном формате…
Вообще-то не должэн импорт останавливаться. Ищите причину в другом.
whois
Еще тупой вопрос.
Я пробовал не в бинарном формате…
Ну, то есть 2021-01-01 10:11:12 — это вполне нормальный timestamp, ничего такого чтобы его не загрузить.
I have database table having one column defined as timestamp without time zone
. Now from my c# application, when I try to insert null value in that column using NpgSql BeginBinaryImport
it gives error message as mentioned below:
08P01: insufficient data left in message
Below is the code which I am trying to execute:
static void Main(string[] args)
{
BulkInsert();
}
private static void BulkInsert()
{
DataTable table = new DataTable();
table.Columns.Add("firstname", typeof(String));
table.Columns.Add("lastname", typeof(String));
table.Columns.Add("logdatetime", typeof(DateTime));
table.Columns.Add("status", typeof(int));
table.Columns.Add("id", typeof(long));
var dataRow = table.NewRow();
dataRow["firstname"] = "MyFirstName";
dataRow["lastname"] = "MyLastName";
dataRow["logdatetime"] = DBNull.Value;
dataRow["status"] = 1;
dataRow["id"] = 10;
table.Rows.Add(dataRow);
var data = new DataAccess();
using (var npgsqlConn = new NpgsqlConnection([ConnectionString]))
{
npgsqlConn.Open();
var commandFormat = string.Format(CultureInfo.InvariantCulture, "COPY {0} {1} FROM STDIN BINARY", "logging.testtable", "(firstName,LastName,logdatetime,status,id)");
using (var writer = npgsqlConn.BeginBinaryImport(commandFormat))
{
foreach (DataRow item in dataTable.Rows)
{
writer.StartRow();
foreach (var item1 in item.ItemArray)
{
writer.Write(item1);
}
}
}
npgsqlConn.Close();
}
asked May 25, 2016 at 7:57
The issue is the DBNull.Value
you’re trying to write — Npgsql doesn’t support writing nulls this way. To write a null you need to use the WriteNull()
method instead.
I can make Npgsql accept DBNull.Value
, but only for the overload of Write()
which also accepts an NpgsqlDbType (because Npgsql has to write the data type, and with DBNull.Value
we have no idea what that is).
EDIT: Have done this, see https://github.com/npgsql/npgsql/issues/1122.
answered May 25, 2016 at 8:17
Shay RojanskyShay Rojansky
15k2 gold badges40 silver badges68 bronze badges
2
I faced same issue while bulk copying data in table. To solve this I have created an extension method so you dont have to null check on all fields
public static void WriteWithNullCheck(this NpgsqlBinaryImporter writer, string value)
{
if (string.IsNullOrEmpty(value))
{
writer.WriteNull();
}
else
{
writer.Write(value);
}
}
this can be made generic by
public static void WriteWithNullCheck<T>(this NpgsqlBinaryImporter writer, T value,NpgsqlDbType type)
{
if (value == null)
{
writer.WriteNull();
}
else
{
writer.Write(value, type);
}
}
answered Jul 24, 2017 at 4:48
prashantprashant
2,1812 gold badges22 silver badges37 bronze badges
@manandre thanks for helping on this!
For some background, PostgreSQL binary import via COPY is a bit problematic, since Npgsql has no knowledge of what types PostgreSQL is expecting, and the protocol doesn’t contain type OIDs for us to tell PostgreSQL what we’re sending. In other words, when a user executes:
var writer = conn.BeginBinaryImport("COPY data (field_text, field_int2) FROM STDIN BINARY");
we have no idea what’s in that COPY command, and even if we did, we still have no idea what field_text and field_int2 actually are (though in theory we could parse and send a Describe message on the data table). So at the moment it’s really the user’s responsibility to match the data types to what PostgreSQL is expecting — otherwise the error above occurs. At some point I considered obsoleting the Write overload that doesn’t accept an NpgsqlDbType, as a way to force the user to at least think about it.
As this issue has been open for a long time (sorry about that), I’ll go ahead and close it now. @AbdallahEsam if @manandre’s answer doesn’t fix the issue for you, please post back here and we’ll revisit.
9 Answers
- Newest
- Most votes
- Most comments
I have had no luck here.
Does multi-label require over ten examples for each «combination» of labels?
For example, my training data has ten categories with many thousands of trained examples.
LABEL1,»document»
LABEL2,»document»
LABEL3,»document»
LABEL2|LABEL3,»document»
When labels are combined there are situations where ten examples may not exist. Is this what would cause the training to fail?
I can add more training data but it seems a waste of time if it is not even clear. Amazon should provide better documentation on the training files.
Hi,
So when I ran into this issue the way I had to resolve it was by making sure my data/csv had 10 of each label, so:
Label1 and Label2 and Label3 etc. — should have 10 or more occurrences in the csv
if any one of your labels does not have 10 or more occurrences, the training will fail, Insufficient Data message (example below)
Fail:
Label1|Label2
Label1|Label2
Label1|Label2
Label1|Label2
Label1
Label1
Label1
Label1
Label1
Label1
Thanks I finally found a rogue character in my file. Now resolved
Hi,
I am from the Comprehend Engineering team. Can you please PM your accountID, region, and classifier name which encountered the issue? We would like to improve the customer experience in detecting such characters that trip up our training and informing the user about where to look.
Thanks!
Seema Suresh
I’m having a similar issue — I have enough labels, but the classifier training fails. What character was it that was causing an issue in the end, so I can check for that and remove it?
Hello ,
I started creating my first labelling job(Crowd classifier-Multi select) using sagemaker console(workforce already setup). Input data is a CSV file with free text(chats from twitter data set). I added my own new labels. When I spin up the labelling tool for preview before creating the job, it shows no error but after I create the job and then spin up the labelling tool UI(Crowd source),
I get the following error :
(Element type CROWD-CLASSIFIER-MULTI-SELECT): attributes should have required property ‘categories’
Details:
My CSV input file has two columns(text_id, text) —
text_id Text
1001 <text to be labelled by labelling job>
I added my own categories(labels) after creating the mainfest file
Any help is appreciated on this issue?
Looks like I am missing something basic here.
Hi,
I am from the Comprehend engineering team.
It sounds like your issue is with Sagemaker Groundtruth and not with Comprehend. Is that right?
Thanks,
Seema Suresh
Hey,
as the question wasn’t answered in the forum yet: Do we need 10 samples per combination for a multilabel classification or just 10 samples per label? Is it e.g enough to have 10 samples for CLASS 1 and 10 for CLASS 2 or do I also need 10 samples for the combination of CLASS 1 & CLASS 2?
Thanks in advance
Hey,
as the question wasn’t answered in the forum yet: Do we need 10 samples per combination for a multilabel classification or just 10 samples per label? Is it e.g enough to have 10 samples for CLASS 1 and 10 for CLASS 2 or do I also need 10 samples for the combination of CLASS 1 & CLASS 2?
Thanks in advance
A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.
Guidelines for Answering Questions
Relevant content
-
Accepted Answer
-
AWS OFFICIALUpdated 9 months ago
-
AWS OFFICIALUpdated 7 months ago
-
AWS OFFICIALUpdated a month ago
-
AWS OFFICIALUpdated 2 years ago
-
-